Use the "script" element to include scripts and data blocks in the document. Use the "src" attribute to specify a script in an external file.
Attributes for "script"
|'Standard' Attributes||"charset", "defer", "integrity", "language", "nomodule", "src", and "type"|
|New HTML5 Attributes||"async" and "crossorigin"|
|Obsolete Attributes||"for" and "event"|
Syntax Notes for "script"
- The end tag is required.
- In HTML5+,
- It's generally best to use the "src" attribute to place scripts in external files.
Search Engine Optimization (SEO)
- Avoid using client-side scripting to insert tags and content into web pages. Don't use client-side scripting to link to other documents. Search Engines don't run client-side scripting. It's also a bad idea because it should not be assumed that scripting is available (and turned on) in the user's browser.
Search Engine Links (for more information)