Return to Kroll Design home page

JavaScript Tutorials

 
« 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:



 
« Return


©2012 Kroll Design    info@KrollDesign.net    781.910.3694
Last modified: 12/31/1969 7:00 PM