Specifies that the enclosed content is a client-side script.
Platform Support
IE | Netscape | Mozilla | Opera | Safari | 3.0+ | 2.0+ | 1.0+ | 4.0+ | 1.0+ |
---|
Example
This example shows a basic <script> element for a JavaScript script:
<script language="type/javascript">
<!-- JavaScript script... -->
</script>
<noscript> Your browser does not support JavaScript. </noscript>
Remarks
Add the <noscript> </noscript> tags in case users have JavaScript turned off in their browsers.
Attribute Detail
Attribute | IE | Netscape | Mozilla | Opera | Safari |
---|---|---|---|---|---|
Specifies the character set associated with the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
If present, specifies that execution of the element is deferred. | 3.0+ | 2.0+ | 1.0+ | 7.0+ | 1.0+ |
Specifies the event handler for the element. | 3.0+ | no | no | no | no |
Id corresponding to the form or event associated with the element. | 4.0+ | 1.1+ | 1.0+ | no | 1.0+ |
Unique identifier for the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
language (script)
Specifies the scripting language. | 3.0+ | 2.0+ | 1.0+ | 4.0+ | 1.0+ |
URL for the source for the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
type (script)
Specifies the type of script. | 3.0+ | 2.0+ | 1.0+ | 4.0+ | 1.0+ |
If set, specifies whether to override the default whitespace handling within the element. | 5.0+ | no | no | no | no |
Event Detail
Event | IE | Netscape | Mozilla | Opera | Safari |
---|---|---|---|---|---|
Fires when the content of the element finishes loading. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
Fires when one of the properties of the element changes. | 4.0+ | no | no | no | no |
Fires when the ready state of the element changes. | 4.0+ | no | no | no | no |
Availability
W3C HTML 4.01