Thursday, March 8, 2012

<!--comment-->

f
f
HTML
RESULT
f f
<!---This is Comment-->
<p>This is paragraph</p>

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari
It is also a good practice to use the comment tag to "hide" scripts from browsers without support for it (so they don't show them as plain text):

<script type="text/javascript">
<!--
function displayMsg()
{
alert("Hello World!")
}
//-->
</script> 

Note: The two forward slashes at the end of comment line (//) is the JavaScript comment symbol. This prevents JavaScript from executing the --> tag.

This is paragraph

No comments:

Post a Comment