script

Specifies that the enclosed content is a client-side script.

Platform Support

IENetscapeMozillaOperaSafari
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

AttributeIENetscapeMozillaOperaSafari
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+
 
event
[event-name]. Example values: onclick, onchange, etc.
Specifies the event handler for the element.
3.0+nononono
 
for
[element-id]. Example values: myButton, textBox1, etc.
Id corresponding to the form or event associated with the element.
4.0+1.1+1.0+no1.0+
 
id
[element-id]
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+
 
src
[url]
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+nononono
 

Event Detail

EventIENetscapeMozillaOperaSafari
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+nononono
 
Fires when the ready state of the element changes.
4.0+nononono
 

Availability

W3C HTML 4.01

text_html aptana_docs