What is the <noscript> element in HTML?

The <noscript> element in HTML is used to display alternate content in case the <script> element is unsupported on the browser or the user has intentionally disabled scripting in their browser for efficiency or security purposes. However, when scripting is enabled, the content inside the <noscipt> element is not displayed.

<noscript> is used inside the <head> and <body> elements. When used inside the <head> element, the children elements of <noscript> are restricted to <link>, <meta>, and <style>.

Example

Explanation

In lines 4-6, we write a simple script inside the <script> element that displays the message “Scripting is enabled on your browser!” on the webpage. In lines 7-9, we write an alternative message, “Scripting is disabled on your browser!”, inside the <noscript> element, which is displayed on the webpage if scripting is disabled or unsupported on the browser.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved