471,603 Members | 1,484 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

script tag

Can you just give me the use of <!-- tag in java script in html..?
and the proper syntax to it...
Nov 22 '07 #1
3 1427
7,435 Expert 4TB
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.
Nov 22 '07 #2
Script tag in html: <script></script>
Nov 27 '07 #3
Death Slaught
1,137 1GB
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">

Use the type attribute otherwise not everything will work.

Hope it helps, Death
Nov 27 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Mike Daniel | last post: by
2 posts views Thread by bilaribilari | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.