Articles → JavaScript → Comments In Javascript

Comments In Javascript

  1. Single line comments
  2. Multiline comments

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.


	<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");

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


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


Your Email Id  
Query/FeedbackCharacters remaining 250