HTML <script> tag
Depending on your requirement, you can run scripts to change the behavior of your HTML document.
<script> document.getElementById("test").innerHTML = "Learn CSS from TutorialBrain"; </script>
How Browser will display
Difference between HTML4.01, XHTML and HTML5
|None||None||New async attribute is added in HTML5.|
Attributes used with <script> tag
|async||defines that the script is executed asynchronously (only for external scripts)|
|charset||defines the character encoding used in an external script file|
|defer||defines that the script is executed when the page has finished parsing (only for external scripts)|
|src||defines the URL of an external script file|
|type||defines the media type of the script|
|xml:space||defines whether whitespace in code should be preserved( It is deprecated now and you should avoid using this attribute.)|
The <script> tag supports Global attributes.
The <script> tag supports Event attributes.