Home > Web Front-end > Front-end Q&A > How to use html noscript tag

How to use html noscript tag

藏色散人
Release: 2019-05-27 10:21:44
Original
3378 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template