Skip to content

Instantly share code, notes, and snippets.

@apphp
Created January 29, 2014 10:14
Show Gist options
  • Save apphp/8685076 to your computer and use it in GitHub Desktop.
Save apphp/8685076 to your computer and use it in GitHub Desktop.
Comments 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).
Source: http://www.apphp.com/index.php?snippet=html-comments-tag
<!-- This is a comment. Comments are not displayed in the browser. -->
<div id="header">
<p>Some text</p>
</div> <!-- END div-header -->
<script type="text/javascript">
<!--
function ShowMessage()
{
alert("Hello World!")
}
//-->
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment