Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7419689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:06:50+00:00 2026-05-29T08:06:50+00:00

What is the purpose of using // in the following code. If old browsers

  • 0

What is the purpose of using // in the following code. If old browsers doesnt support javascript then the symbols <!-- --> will ignore js code. In case browsers support JS, these symbols <!-- --> will be ignored. Then wats the use of // symbols.

<html>
<body>
<script type="text/javascript">
<!--
document.getElementById("demo").innerHTML=Date();
//-->
</script>
</body>
</html>  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:06:51+00:00Added an answer on May 29, 2026 at 8:06 am

    If old browsers doesnt support javascript then the symbols <!-- --> will ignore js code.

    True, assuming HTML and for a definition of “old browsers” equal to “Netscape 1 era”. Don’t use them today.

    In case browsers support JS, these symbols <!-- --> will be ignored.

    Only half true. Only the start of the comment is special cased. From the specification:

    The JavaScript engine allows the string “<!--” to occur at the start of a SCRIPT element, and ignores further characters until the end of the line. JavaScript interprets “//” as starting a comment extending to the end of the current line. This is needed to hide the string “-->” from the JavaScript parser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does the following code render the using(...) function/purpose irrelevant? Would it cause a deficiency
The purpose of using a Javascript proxy for the Web Service using a service
I'm using the following HTML code to autoselect some text in a form field
i have the following code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using
This following code snippet works fine using jQuery1.2.3, but it doesn’t work with latest
I am using zend_lucene for search functionality.I 've the following code, $doc->addField(Zend_Search_Lucene_Field::Text('categoryName', $result->name)); Here
I am using the following VBA code to change the color of the rows
I created an LinearLayout using the following code: LayoutInflater inflater = getLayoutInflater(); LinearLayout container
I am using zend framework... so I have the following code in display.php: <?php
I was using the following code to send data asynchronously but I noticed that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.