<noscript>
HTML <noscript> Tag
Instance
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> </head> <body> <script> document.write("Hello World!") </script> <noscript>抱歉,你的浏览器不支持 JavaScript!</noscript> <p>不支持 JavaScript 的浏览器会使用 <noscript> 元素中定义的内容(文本)来替代。</p> </body> </html>
Run Example»
Click the "Run Instance" button to view the online instance
Browser support
Currently most browsers support < p> tag.
Tag definition and usage instructions
The noscript element is used to define alternative content (text) when the script is not executed.
This tag can be used with browsers that recognize the <noscript> tag but cannot support the scripts contained within it.
Tips and Notes
Tips: If the browser supports scripts, it will not display the text in the noscript element.
Note: Browsers that cannot recognize the <script> tag will display the content of the tag on the page. To prevent browsers from doing this, you should hide the script in comment tags. Older browsers (that don't recognize <script> tags) ignore comments and thus don't write the content of the tag to the page, while newer browsers know how to execute these scripts even if they are surrounded by comment tags. !
<!--
function displayMsg()
{
alert("Hello World!")
}
//-->
</script>
##Differences between HTML 4.01 and HTML5In HTML 4.01,< The ;noscript> tag is only allowed to be inserted into the <body> element. In HTML5, the <noscript> tag can be inserted into the <head> and <body> areas.
Differences between HTML and XHTMLXHTML does not support the <noscript> tag.
Global attributes<noscript> tag supports global attributes, see the complete attribute table HTML global attributes.
Related ArticlesHTML Tutorial: HTML Script