JS: How to dispaly warning message if JavaScript is Disabled in user's Web Browser | JavaScript

Display JavaScript Disabled Warning

Learn how to show message on HTML page if JavaScript is disabled in the web browser. The HTML tag detects either JavaScript is disabled in the web browers of the visitor. Pure HTML code example works for all major brower like Google Chrome, Mozilla Firefox, Opera, Microsoft Edge, Microsoft Internet Explorer, Apple Safari etc. with noscript tag.

Display warning if JavaScript is Disabled in web browsers

This article guide you how to display message on a web page to a visitor if JavaScript is disabled in the web browser's settings.

<noscript> JavaScript is not supported! </noscript>

JavaScript is not supported!

The code under noscript tag is ignored if the web browser supports JavaScript and the JavaScript is enabled in settings.

Sometimes users intentionally or unintentionally disable JavaScript in their web browser settings. This leads to stop the execution of JavaScript.

Why website visitor disable JavaScript

For several reasons websites collect data and/or do some cross-platform operations. This all involve data. Even though, sometimes potentional dangerous activities are laso performed and this all done thorugh JavaScript code execution. Some pishing websites also do this. To avoid such threats, users disable JavaScript from the web browser's settings to avoid any uncomfortable situation.

Displaying attrcative message for disabled JavaScript

Following code displays the attractive message.

<noscript> <h2>JavaScript is not supported!</h2> <p>Dear user! We understand your concerns but we need JavaScript enabled browser let this benefit you at its best.</p> </noscript>
You need to disable JavaScript in your web browser settings to see the code under noscript tags.