Saturday, September 1, 2012

HTML comment lines and JavaScript comment lines



It is important to write comment lines to HTML files and JavaScript files for web designer. It can help web designers to well organize the code.
1. HTML comment line
start with <!-- (no space between <! and --), end with --> (it is OK to have space between -- and >)
Example
<!--
This is HTML comment line
-->

2. JavaScript comment line
single line comment starts with //
Example
// This is JS single line comment

Multiple lines start with /* and end with */
Example
/*
This JS multiple line
comment
*/

For JavaScript document line, start with /** and end with */
Example:
/**
  * This is function Helloworld()
 * @author Jiansen
  * @version 1.1.0
*/

No comments:

Post a Comment