Comments in HTML


/ Published in: HTML

The syntax is the HTML comment. This is the way to add your own notes into the code which will not display when the HTML is rendered by the browser. It is also a good practice for web-developers to use the comment tags to "hide" scripts from browsers without support for it (so they don't show them as a plain text).


Copy this code and paste it in your HTML
  1. <!-- This is a comment. Comments are not displayed in the browser. -->
  2.  
  3. <div id="header">
  4. <p>Some text</p>
  5. </div> <!-- END div-header -->
  6.  
  7. <script type="text/javascript">
  8. <!--
  9. function ShowMessage()
  10. {
  11. alert("Hello World!")
  12. }
  13. //-->

URL: http://www.apphp.com/index.php?snippet=html-comments-tag

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.