JQuery Comments

From CoderLearner
Jump to: navigation, search

jQuery Comment jQuery Code

Add comment to jQuery code is important for documentation.

  • Use double forward slash (//) for single line comment.
  • Use /* ............ */ for multiple lines comment.

Syntax

<script language="javascript">
	$(document).ready(function(){
	 // your comment

         /*

             Multiple line comments

         */
	});
</script>

Example

<html>
	<head>
		<title>Basic Jquery</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script type="text/javascript" src="jquery.min.js">
		</script>
		<script language="javascript">
			$(document).ready(function(){
                 // this will assign the Hello World! to the <p> element.
				$("p").html("Hello World!");
                              /* 
                                      your comment is place here!

                              */

			});
		</script>
	</head>
	<body>
		<p></p>
	</body>
</html>

<seo metagenerator="jquery tutorial" title="Jquery/Ajax" metakeywords="jquery greater,jquery gt, jquery lt, less then, odd jquery,jquery find element, even jquery,jquery event, jquery mouse click, jquery double click, jquery hover, jquery string, jquery array, jquery button, jquery attriubtes" metadescription="jquery button, jquery attriubte, jquery example, jquery tutorial, jquery sample"/>