META object (Object/HTML)

An object that represents the contents of a <META> tag.

Availability:

DOM level - 1
JavaScript - 1.5
JScript - 3.0
Internet Explorer - 4.0
Netscape - 6.0
Inherits from:Element object
JavaScript syntax:IEmyMETA = myDocument.all.anElementID
IEmyMETA = myDocument.all.tags("META")[anIndex]
IEmyMETA = myDocument.all[aName]
-myMETA = myDocument.getElementById(anElementID)
-myMETA = myDocument.getElementsByName(aName)[anIndex]
-myMETA = myDocument.getElementsByTagName("META")[anIndex]
HTML syntax:<META>
Argument list:anIndexA reference to an element in a collection
aNameAn associative array reference
anElementIDThe ID value of an Element object
Object properties:charset, content, httpEquiv, name, scheme, url
Event handlers:onClick, onDblClick, onHelp, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp

These tags and their corresponding object instantiations are used to convey hidden information about the document. This information might useful to a search engine for example. Sometimes, the server uses the META information to control the way the pages are cached into a proxy. Likewise, a client browser may use these values to control the local caching and expiry times of a document.

There may be several META objects associated with a document. There is no collection object that provides an enumerable set containing only the META objects but you can traverse the document.all[] collection and extract them in MSIE or use the collection returned by the DOM compliant document.getElementsByTagName("META") method which is supported on Netscape 6.0 and recent versions of MSIE. It is possible you might know the unique ID="..." HTML tag attribute value in which case you can access the required object directly.

This is not currently supported at all in Netscape 4.0 although because it is part of the DOM specification, it is added to Netscape 6.0.

Warnings:

myMeta.httpEquiv is defined as "Content-Type"

myMeta.content is defined as "text/html; charset=8859-1"

myMeta.charset is undefined

See also:<META>, Element object, META.charset

PropertyJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
charset n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-
content1.5 1.53.0 3.06.0 6.04.0 4.0 n/a n/a n/a1 1 n/a n/a-
httpEquiv1.5 1.53.0 3.06.0 6.04.0 4.0 n/a n/a n/a1 1 n/a n/a-
name1.5 1.53.0 3.06.0 6.04.0 4.0 n/a n/a n/a1 1 n/a n/a-
scheme1.5 1.55.0 5.06.0 6.05.0 5.0 n/a n/a n/a1 1 n/a n/a-
url n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-

Event nameJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
onClick1.0 1.01.0 1.06.0 6.04.0 4.03.0 3.0 n/a n/a n/a n/a4.0 4.0Warning
onDblClick1.2 1.23.0 3.06.0 6.04.0 4.03.0 3.0 n/a n/a n/a n/a4.0 4.0Warning
onHelp n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/aWarning
onKeyDown1.2 1.23.0 3.06.0 6.04.0 4.03.0 3.0 n/a n/a n/a n/a4.0 4.0Warning
onKeyPress1.2 1.23.0 3.06.0 6.04.0 4.03.0 3.0 n/a n/a n/a n/a4.0 4.0Warning
onKeyUp1.2 1.23.0 3.06.0 6.04.0 4.03.0 3.0 n/a n/a n/a n/a4.0 4.0Warning
onMouseDown1.2 1.23.0 3.06.0 6.04.0 4.03.0 3.0 n/a n/a n/a n/a4.0 4.0Warning
onMouseMove1.2 1.23.0 3.06.0 6.04.0 4.0 n/a n/a n/a n/a n/a4.0 4.0Warning
onMouseOut1.1 1.13.0 3.06.0 6.04.0 4.03.0 3.0 n/a n/a n/a n/a4.0 4.0Warning
onMouseOver1.0 1.01.0 1.06.0 6.04.0 4.03.0 3.0 n/a n/a n/a n/a4.0 4.0Warning
onMouseUp1.2 1.23.0 3.06.0 6.04.0 4.03.0 3.0 n/a n/a n/a n/a4.0 4.0Warning

Inheritance chain:

Element object, Node object