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

  • Home
  • SEARCH
  • 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 617231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:24:45+00:00 2026-05-13T18:24:45+00:00

Is there a HTML tag that does the opposite of <noscript> ? That is,

  • 0

Is there a HTML tag that does the opposite of <noscript>? That is, displays some content only if JavaScript is enabled? For example:

<ifscript>
<h1> Click on the big fancy Javascript widget below</h1>    
<ifscript>

Of course <ifscript> doesn’t actually exist. I know I could achieve the same result by adding <h1> to the DOM using JavaScript, but if I’d prefer to do this with (X)HTML if possible.

Thanks,
Donal

  • 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-13T18:24:45+00:00Added an answer on May 13, 2026 at 6:24 pm

    There the <script> is for. Just initially hide the particular piece using CSS and use JavaScript to display it. Here’s a basic kickoff example:

    <!doctype html>
    <html lang="en">
        <head>
            <title>SO question 2297643</title>
            <script>
                window.onload = function() {
                    document.getElementById("foo").style.display = 'block';
                };
            </script>
            <style>
                #foo { display: none; }
            </style>
        </head>
        <body>
            <noscript><p>JavaScript is disabled</noscript>
            <div id="foo"><p>JavaScript is enabled</div>
        </body>
    </html>
    

    …or, with little help of jQuery ready() which is a tad sooner with displaying the content:

    <!doctype html>
    <html lang="en">
        <head>
            <title>SO question 2297643 with jQuery</title>
            <script src="http://code.jquery.com/jquery-latest.min.js"></script>
            <script>
                $(document).ready(function() {
                    $('#foo').show();
                });
            </script>
            <style>
                #foo { display: none; }
            </style>
        </head>
        <body>
            <noscript><p>JavaScript is disabled</noscript>
            <div id="foo"><p>JavaScript is enabled</div>
        </body>
    </html>
    

    To improve user experience, consider placing the <script> call directly after the particular HTML element which needs to be toggled, so that there’s no “flash of content” or “element shuffle”. Andrew Moore has given a good example in this topic.

    Alternatively, you can do it (hacky) the other way round with <style> in <noscript>. This is syntactically invalid, but allowed by all browsers from IE6 and up, including the W3C-strict Opera:

    <!doctype html>
    <html lang="en">
        <head>
            <title>SO question 2297643 with CSS in noscript</title>
        </head>
        <body>
            <noscript>
                 <style>#foo { display: none; }</style>
                 <p>JavaScript is disabled
            </noscript>
            <div id="foo"><p>JavaScript is enabled</div>
        </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 299k
  • Answers 299k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I found a good script on TechNet http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/96ccb49f-b669-4e05-965e-3090984a3594.mspx?mfr=true CertImport.vbs Option… May 13, 2026 at 7:47 pm
  • Editorial Team
    Editorial Team added an answer You can have a method that you link as the… May 13, 2026 at 7:47 pm
  • Editorial Team
    Editorial Team added an answer A == Address B == Binding C == Contract You… May 13, 2026 at 7:47 pm

Related Questions

I'm trying to define a vi 'map' command sequence, that would wrap the current
I have a data-source connected to a stored proc that will return the one
Background I am writing and using a very simple CGI-based (Perl) content management tool
I am wondering if there is a way to make ASP.NET controls play nicely
We are supplying a blob of HTML content to be imported and displayed on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.