HTML script Tag
The information on this page is based on HTML version 4.01 (which is the current version of HTML). The next version, HTML 5, is currently being written. Here's a list of HTML 5 tags.
The HTML script tag is used for declaring a script (such as JavaScript) within your HTML document.
Also see the HTML noscript tag for providing content to browsers that don't support your scripting language.
| Example |
<script type="text/javascript">
document.write('The HTML Script tag allows you to place a
script within your HTML documents');
</script>
|
| Attributes: |
| Attributes specific to this tag: |
| Attribute | Description |
| name | Defines the name of the parameter. |
| src | Specifies a URI/URL of an external script. |
| type | Specifies the scripting language as a content-type (MIME type). |
| language | Specifies the scripting language, however, this attribute has been deprecated. Use the type attribute instead. |
| 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. |
| Other Attributes: |
| Attribute | Description |
| charset | Defines the character encoding that the script uses. |
|
| Try it yourself! |
|
Also see the HTML 5 version of HTML tags
Enjoy this page?
-
- Link to this page (copy/paste into your own website or blog):
- Link to Quackit using one of these banner ads.
Thanks for supporting Quackit!