JavaScript Comment

No comments
Comments in JavaScript:

1). Any text between a // and the end of the line is treated as a comment and is ignored by                        JavaScript
2). Any text between the characters /* and */ is treated as a comment. This may span multiple lines.
3). JavaScript also recognizes the HTML comment opening sequence <!--. JavaScript treats this as single line comment.
4). The HTML comment closing sequence --> is not recognized by JavaScript so it should be written as //-->

The following example shows how to use comments in JavaScript

<script language="javascript" type="text/javascript">
<!--
   // This is a comment.
/*
 * This is a multiline comment JavaScript
 */

//-->
</script>


JavaScript Comments

No comments :

Post a Comment

Related Posts Plugin for WordPress, Blogger...