Is JavaScript enabled?

JavaScript FAQ | Basic Syntax & General Questions  

Question: If the user's browser cannot execute JavaScript code, can I display a warning for the user?

Answer: Yes, you can display a special warning for users of JavaScript-incapable browsers. Place your warning text between the tags

<NOSCRIPT>
and
</NOSCRIPT>
.

Here's an example:

<NOSCRIPT>
<H3>This page uses JavaScript</H3> 
<ul>
<li>Please use a JavaScript-aware browser.
<li>Make sure that JavaScript is enabled.
</ul>
</NOSCRIPT>
JavaScript-enabled browsers will ignore everything between
<NOSCRIPT>
and
</NOSCRIPT>
. Browsers that cannot execute JavaScript will display your message on the page. The message will be presented to users who disabled JavaScript – as well as those users whose browsers have no JavaScript support at all.

Historical note:

The
<NOSCRIPT>
tag was not supported by Netscape Navigator 2. Therefore, your message would be visible to Netscape Navigator 2 users even if JavaScript was enabled in their browser.

See also:

Copyright © 1996-2018, JavascriptFAQ.net.