Home  >  Article  >  Web Front-end  >  How to use html noscript tag

How to use html noscript tag

藏色散人
藏色散人Original
2019-05-27 10:21:443326browse

html The noscript tag is used to define alternative content (text) when the script is not executed. This tag can be used by browsers that recognize the <script> tag but cannot support the script in it. </script>

How to use html noscript tag

#html How to use noscript tag?

Function: Used to define alternative content (text) when the script is not executed.

Note: This tag can be used by browsers that recognize the <script> tag but cannot support the script within it. </script>

Note:

If the browser supports scripting, it will not display the text in the noscript element. Browsers that do not 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. </script>

Older browsers (that do not recognize <script> tags) will ignore comments so that the content of the tag will not be written to the page, while newer browsers will know how to execute these scripts, even if they Surrounded by comment tags! </script>

html noscript tag usage example

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    <!--
    document.write("Hello World!")
    //-->
</script>
<noscript>Your browser does not support JavaScript!</noscript>
</body>
</html>

Effect:

How to use html noscript tag

The above is the detailed content of How to use html noscript tag. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn