HTMLScriptElement : HTMLElement
Return to: HTML DOM Level 5 index

Allows authors to include dynamic script and data blocks in their documents.

Platform Support

Mozilla Chrome Safari Opera IE Netscape
1.0+ 5.0+ 1.0+ 4.0+ 3.0+ 2.0+

Constructors

Constructor Action Mozilla Chrome Safari Opera IE Netscape
HTMLScriptElement Constructor() : HTMLScriptElement
Creates an instance of the HTMLScriptElement.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 3.0+ 2.0+

HTMLScriptElement() : HTMLScriptElement

Creates an instance of the HTMLScriptElement.

Returns
HTMLScriptElement

Visibility
internal

Properties

Property Action Mozilla Chrome Safari Opera IE Netscape
src : String
Specifies the address of the external script resource to use.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 3.0+ 2.0+
Availability

WhatWG

async : Boolean
Specifies whether the script should be run asynchronously.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 3.0+ 2.0+
Availability

WhatWG

defer : Boolean
Specifies whether the script is executed when the page has finished parsing.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 3.0+ 2.0+
Availability

WhatWG

type : String
Specifies the language of the script or format of the data.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 3.0+ 2.0+
Availability

WhatWG

charset : String
Specifies the character encoding of the external script resource.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 3.0+ 2.0+
Availability

WhatWG

text : String
Returns the contents of the element, ignoring child nodes that aren't text nodes.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 3.0+ 2.0+
Availability

WhatWG

Inherited Functions

Method Action Mozilla Chrome Safari Opera IE Netscape
getElementsByClassName(String classNames) : NodeList
Returns a NodeList containing all the Element nodes with the specified classNames.
Show Details 1.9+ 5.0+ 3.1+ 9.51+ no no

Parameters
String classNames (one-or-more)A string representing the class name(s) of the elements to return. Multiple class names should be separated by spaces.

Returns
NodeList

Using getElementsByClassName

                        	                    document.getElementById("useCases").getElementsByClassName("question");

Would return a NodeList of all elements inside the element with the id "useCases" to which the class "question" applies.

                        	                    document.getElementById("useCases").getElementsByClassName("question issue");

Would return a NodeList of all elements inside the element with the id "useCases" to which both the classes "question" and "issue" apply.

Remarks

Returns a list of child elements to which the specified className applies. The returned NodeList is sorted in tree order (the order the elements were found during a depth-first preorder traversal through the node tree).

See Also

Document.getElementsByClassName|Element.getElementsByClassName|HTMLDocument.getElementsByClassName

Availability

HTML 5|W3C|W3C

References

HTMLScriptElement

Availability

JavaScript 1.2|WhatWG

text_javascript aptana_docs