JavaScript is a client-side scripting language that can help HTML implement some dynamic functionality.
Example
1. Loading a JavaScript file
<head> <scripttype="text/javascript"src="dreamdu.js"></script></head>
2.script tags--using scripts in documents
The
- script tag appears in pairs, with
<script> start with </script> End
- Properties
-
src --Specifies the address URI of the script file (for example: JS file) that needs to be loaded
-
type --Specifies the media type (for example: Code>type= "Text/javascript" )
<head> <scripttype="text/javascript"src="dreamdu.js"></script></head>
These two methods are also the same, it is recommended to use the first method
HTML NoScript Tags
NoScript tags--prompt text when scripts cannot be loaded
- noscript tags are paired up to
<noscript> start to </noscript> end
- Citation URL: http://www.dreamdu.com/xhtml/tag_noscript/
Example
<noscript>此页面无法加载js脚本代码.</noscript>
Using JavaScript in HTML