Return to Kroll Web Design home page JavaScript

« Return

comments

//
the double slash comments out anything after it, just on that one line

/* */
anything between the slash-star and star-slash is considered a comment. the star-slash can be on a subsequent line if desired.

Code:

<script type="text/javascript">
//<![CDATA[
a = 2; // comment goes here

// this is another comment

/* and this is yet
   another comment */
b = 3;

document.write("a=", a, ", b=", b);
//]]>
</script>

Output:




©2010 Kroll Web Design    davidarthurkroll@verizon.net    781.910.3694

Valid XHTML 1.0 Transitional Valid CSS!