HTML Comments Tag | CodingSource

HTML Comments Tag

The comment tag allows you to add comments to the page source. This tag is not displayed by browsers. The comment tag starts with <!-- and ends with -->. You can use it as a single line or multiple lines.

With this tag, if you want to change the content of your page in the future, you can get an idea about the content. It is very useful in this respect. 

<!-- Single line comment, this content is not displayed in the browser. -->

<!--

multi-line

one more comment.

-->

<p>paragraph tag</p>

You can also enable browsers that do not support javascript to detect this content as a comment with this tag. Javascript tag;

<script type="text/javascript">

<!--

alert("Hello World")

//-->

</script>

The "//" in the comment end tag declares the JavaScript comment definition.

Html Codes Related Posts

Newer Post Load More Pages..