Change Language


Follow Navioo On Twitter

script

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

Browser/User Agent 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+
 
event
[event-name]. Example values: onclick, onchange, etc.
Specifies the event handler for the element.
3.0+ no no no no
 
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+ no 1.0+
 
id
[element-id]
Unique identifier for the element.
2.0+ 1.0+ 1.0+ 4.0+ 1.0+
 
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+
 
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
 

Examples -> Source code Demo online - > script:

Ajax Javascript feed

↑ Grab this Headline Animator