Articles → JavaScript → Comments in JavaScript

Comments in JavaScript












Single line comments




// This is a single line comment.



Multiline comments




		   
    /*
	    This is a multiline comment .
      In this  you can write any no.of lines.
  */




<html>

<head>
	<title>Comments example</title>
	<script language="JavaScript">
	/*
		    Code added by : GyanSangrah
		    Code added on : September 13, 2010		
		*/
	function ClickMe() {
		// This piece of code will fire an alert.	
		// It is important to add semi colon  at the end to avoid 
		// any javascript error.
		alert("Hi, this is a comments sample");
	}
	</script>
</head>

<body>
	<form>
		<input type="button" name="btnComments" value="Click Me" onclick="javascript:ClickMe();"> </form>
</body>

</html>





Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, December 28, 2010

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250