Noscript tag in HTML
- 24-07-2022
- Trung Minh
- 0 Comments
The noscript tag defines what to display instead if the user's browser has scripting disabled or not supported.
The noscript element can be used in both the head tag and the body tag, if used in the head tag, noscript will only contain the link, style, and meta elements.
The contents of the noscript tag will be displayed when scripts are not supported or disabled by the browser.
By definition, if the browser supports scripts, the noscript tag will not work, so you can use it as a hidden comment for scripts.
Using
For example , use the noscript tag to display alternate content when the browser disables scripting.
You turn off your browser's javascript and run the following code to see the result:
<!DOCTYPE html> <html> <body> <script> document.write("Hello web888.vn!") </script> <noscript>Trình duyệt của bạn không hỗ trợ sử dụng Javascript!</noscript> <p>Học html miễn phí tại web888.vn</p> </body> </html>