script tag

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ScripterSam
    New Member
    • Oct 2007
    • 16

    script tag

    Can you just give me the use of <!-- tag in java script in html..?
    and the proper syntax to it...
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    I don't know what you are asking. If you want to know what a javascript comment tag is:
    //this is a comment.

    But that is in a javascript script.

    Comment

    • nirchuk
      New Member
      • Nov 2007
      • 4

      #3
      Script tag in html: <script></script>

      Comment

      • Death Slaught
        Top Contributor
        • Aug 2007
        • 1137

        #4
        That's the begging of a comment.

        <!-- Comment goes here -->

        Note: The comment tag is used to insert a comment in the HTML source code. A comment will be ignored by the browser. You can use comments to explain your code, which can help you when you edit the source code at a later date.

        As for JavaScript if your comment is only one line long you would do this:

        //Comment goes here

        If your Comment were to go further than one line, you would use this method of commenting:

        /* Comment goes here */

        Also Javascript comments can only go between the "script" tags, however, nirchuck gave you an example of using the "script" tag. When using JavaScript, the proper way is like this:

        <script type="text/javascript">
        </script>

        Use the type attribute otherwise not everything will work.

        Hope it helps, Death

        Comment

        Working...