Jump to content

<img> tag in javascript comment


Andynic

Recommended Posts

Hi,
Does anyone have any idea why the W3 validation service returns the error shown below on this comment line?/* Set the values in the <img> tag so the user can see a mini-sample of what was selected */Error:=====Line 219, Column 40: required attribute "src" not specified… /* Set the values in the <img> tag so the user can see a mini-sample …✉The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.=====I've tried /* */ to enclose the comment and also //Thanks for your help.andynic

 

Link to comment
Share on other sites

Thanks. That was it.
Probelm solved:
mismatch in <header> of the "comment" tokens <!-- ... //--> between <script> and </script> tags:
probelm code:
<script type="text/javascript">
<!--
javascript functions....
-->
</script>
Corrected:
<script type="text/javascript">
<!--
javascript functions....
//-->
</script>
andynic
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...