HTML Home
HTML Tags Reference
Selected Reading
© 2013 TutorialsPoint.COM
|
HTML <script> tag
Advertisements
Function:
The HTML <style> tag is used for declaring a script (such as JavaScript) within your HTML document.
Difference between HTML and XHTML:
NONE
Example:
<script type="text/javascript">
document.write("Hello Javascript!")
</script>
|
This will produce following result:
For more detail on <script> tag please check HTML Scripts chapter.
Online Practice:
To Become more comfortable - Do Online Practice
Attributes:
| Attribute | Value | Description |
| type | text/javascript application/ecmascript application/javascript text/vbscript | Specifies the scripting language as a content-type (MIME type). |
| charset | charset | Defines the character encoding that the script uses. |
| defer | defer | Declares that the script will not generate any content. Therefore, the browser/user agent can continue parsing and rendering the rest of the page. |
| language | javascript livescript vbscript other | Deprecated - Specifies the scripting language. Don't use this attribute use the type attribute instead. |
| src | URL | Specifies a URI/URL of an external script. |
Standard Attributes:
| Attribute | Description |
| xml:space | Sets the language code. |
Advertisements
|
|
|