HTML <noscript> Tag
Description
The <noscript>
HTML tag is used to provide alternative content or instructions for web browsers that do not support JavaScript or have JavaScript disabled. When a user's browser lacks JavaScript support, the content within the 'noscript' tag is displayed instead. This tag is valuable for ensuring that critical functionality or important information is still accessible to users with non-JavaScript-capable browsers, thereby enhancing the accessibility and usability of a website. It is typically employed in conjunction with JavaScript to create a fallback mechanism for users who rely on less capable browsers or have intentionally disabled JavaScript for security or other reasons.
Properties
- Permitted Parents
- Any element that accepts phrasing content, if there are no ancestor <noscript> element, or in a <head> element (but only for an HTML document), here again if there are no ancestor <noscript> element
- Content
- Block, inline, and text when it isn't a descendant of the <head> element; Otherwise <link>, <style>, and <meta> elements.
- Start/End Tags
- Start tag: required, End tag: required
Example
<script type="text/javascript">
document.write("Hello World!")
</script>
<noscript>Your browser does not support JavaScript!</noscript>
Attributes
None
Global Attributes
The <object>
tag also supports the Global Attributes in HTML5
Event Attributes
The <object>
tag also supports the Event Attributes in HTML5
Browser Support
The following table will show you the current browser support for the HTML <noscript>
tag.
Desktop | |||||
12 | 1 | 1 | 15 | 3 |
Tablets / Mobile | |||||
18 | 4 | 14 | 2 | 1 | 4.4 |
Last updated by CSSPortal on: 30th September 2023