Posted By

apphp-snippets on 02/03/14


Tagged

html in comments apphp


Versions (?)

Comments in HTML


 / Published in: HTML
 

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

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).

  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. //-->

Report this snippet  

You need to login to post a comment.