Package | dom.core |
Class | public class Attr |
Inheritance | Attr Node Object |
Introduced in: | DOM 1 Core |
Modified in: | DOM 3 Core |
See also
Property | Defined By | ||
---|---|---|---|
DOM 1 Core attributes : NamedNodeMap [read-only]
Returns an unordered collection of Attr nodes. | Node | ||
Non-Standard baseName : DOMString [read-only]
Returns the base name for the name qualified with the namespace. | Node | ||
DOM 3 Core baseURI : DOMString [read-only]
The absolute base URI of this node or null if the implementation
wasn't able to obtain an absolute URI. | Node | ||
DOM 1 Core childNodes : NodeList [read-only]
Returns an ordered collection of node objects that are children of
the current element. | Node | ||
Non-Standard dataType : *
Specifies the data type for this node. | Node | ||
Non-Standard definition : Node [read-only]
Returns the definition of the node in the document type definition (DTD) or schema. | Node | ||
Non-Standard expando : Boolean
Sets or retrieves a value indicating whether arbitrary variables can be created within the object. | Attr | ||
DOM 1 Core firstChild : Node [read-only]
Returns the node's first child in the tree, or null if the node is
childless. | Node | ||
DOM 3 Core isId : Boolean [read-only]
Returns whether this attribute is known to be of type ID (i.e. | Attr | ||
DOM 1 Core lastChild : Node [read-only]
Returns the last child of a node. | Node | ||
DOM 2 Core localName : DOMString [read-only]
Returns the local part of the qualified name of this node. | Node | ||
DOM 1 Core name : DOMString [read-only]
Returns the name of this attribute. | Attr | ||
DOM 2 Core namespaceURI : DOMString [read-only]
The namespace URI of the node, or null if it is unspecified (read-only). | Node | ||
DOM 1 Core nextSibling : Node [read-only]
Returns the node immediately following the specified one in its
parent's childNodes list, or null if the specified node is the
last node in that list. | Node | ||
DOM 1 Core nodeName : DOMString [read-only]
Returns the name of the current node as a string. | Node | ||
Non-Standard nodePrincipal : nsIPrincipal [read-only]
Returns the nsIPrincipal object representing current security
context of the node. | Node | ||
DOM 1 Core nodeType : Number [read-only]
Returns an integer code representing the type of the node. | Node | ||
Non-Standard nodeTypedValue : *
Contains the node value expressed in its defined data type. | Node | ||
Non-Standard nodeTypeString : DOMString [read-only]
Returns the node type in string form. | Node | ||
DOM 1 Core nodeValue : DOMString
Returns or sets the value of the current node. | Node | ||
DOM 1 Core ownerDocument : Document [read-only]
The Document object associated with this node. | Node | ||
DOM 2 Core ownerElement : Element [read-only]
The Element node this attribute is attached to or null if this
attribute is not in use. | Attr | ||
DOM 1 Core parentNode : Node [read-only]
Returns the parent of the specified node in the DOM tree. | Node | ||
Non-Standard parsed : Boolean [read-only]
Indicates the parsed status of the node and child nodes. | Node | ||
DOM 2 Core prefix : DOMString
Returns the namespace prefix of the specified node, or null if no
prefix is specified. | Node | ||
DOM 1 Core previousSibling : Node [read-only]
Returns the node immediately preceding the specified one in its
parent's childNodes list, null if the specified node is the first
in that list. | Node | ||
DOM 3 Core schemeTypeInfo : TypeInfo [read-only]
The type information associated with this attribute. | Attr | ||
DOM 1 Core specified : Boolean [override] [read-only]
True if this attribute was explicitly given a value in the instance
document, false otherwise. | Attr | ||
Non-Standard text : DOMString
Represents the text content of the node or the concatenated text representing the node and its descendants. | Node | ||
DOM 3 Core textContent : DOMString
Gets or sets the text content of a node and its descendants. | Node | ||
DOM 1 Core value : DOMString
On retrieval, the value of the attribute is returned as a string. | Attr | ||
Non-Standard xml : DOMString [read-only]
Contains the XML representation of the node and all its descendants. | Node |
Event | Summary | Defined By | ||
---|---|---|---|---|
A node has been added as a child of another node or, in case of Attr nodes, has been added to an Element. | Attr | |||
A node has been inserted into a document, either through direct insertion of the node or insertion of a subtree in which it is contained; Attr nodes are considered part of an Element's subtree. | Attr | |||
A node is being removed from its parent node or, in case of Attr nodes, removed from its ownerElement. | Attr | |||
A node is being removed from a document, either through direct removal of the node or removal of a subtree in which it is contained; Attr nodes are considered part of an Element's subtree. | Attr | |||
This is a general event for notification of all changes to the document. | Attr |
expando | property |
expando:Boolean
Product Versions : | 5.5 6.0 7.0 8.0 as IE7 8.0 as IE8 2.0 3.0 3.5 3.0 3.1 4.0b 1.0 2.0 9.62 10.0a |
Non-standard (Microsoft)
Sets or retrieves a value indicating whether arbitrary variables can be created within the object.
Note: You can extend the properties on an object by creating arbitrary properties with values. You should be careful, however, because you can unintentionally set a property value when scripting in a case-sensitive language such as Microsoft JScript. For example, if the property value is borderColor and you type the value "bordercolor = 'blue'", you have, in fact, created another property on the style object called bordercolor with the value 'blue'. If you query the value of the property, the value "blue" is returned. However, the borders for the element do not turn blue.
Note: Setting the expando property of the document object to false precludes the functionality of all expandos within the document.
The default value is true
.
public function get expando():Boolean
public function set expando(value:Boolean):void
See also
<html> <head> <script type="text/javascript"> //Set the expando property to false. document.expando = false; </script> </head> <body> <div> <span id="oSpan" unselectable="on">This text should be selectable.</span> </div> </body> </html>
DOM 3 Core isId | property |
isId:Boolean
[read-only] Introduced in: | DOM 3 Core |
Returns whether this attribute is known to be of type ID (i.e. to contain an identifier for its owner element) or not.
When it is and its value is unique, the ownerElement of this attribute can be retrieved using the method Document.getElementById.
public function get isId():Boolean
See also
DOM 1 Core name | property |
name:DOMString
[read-only] Introduced in: | DOM 1 Core |
Returns the name of this attribute. If Node.localName is different from null, this attribute is a qualified name.
Note (IE8): Internet Explorer 8 and later. In IE8 mode, dynamically setting the name attribute on an input type=radio button correctly applies that button to the same named group.
Note (IE): When submitting a form, use the name property to bind the value of the control. The name is not the value displayed for the input type=button, input type=reset, and input type=submit input types. The internally stored value is submitted with the form, not the displayed value.
Note (IE): Microsoft JScript allows the name to be changed at run time. This does not cause the name in the programming model to change in the collection of elements, but it does change the name used for submitting elements.
Note (IE8): Internet Explorer 8 and later can set the NAME attribute at run time on elements dynamically created with the createElement method. To create an element with a NAME attribute in earlier versions of Internet Explorer, include the attribute and its value when using the createElement method.
public function get name():DOMString
See also
var inp = document.createElement('input'); inp.setAttribute('type', 'radio'); inp.setAttribute('name', 'Q'+count); inp.setAttribute('value', answers[i]);
DOM 2 Core ownerElement | property |
ownerElement:Element
[read-only] Introduced in: | DOM 2 Core |
The Element node this attribute is attached to or null if this attribute is not in use.
Note (IE8): This property is new as of Internet Explorer 8.
public function get ownerElement():Element
See also
DOM 3 Core schemeTypeInfo | property |
schemeTypeInfo:TypeInfo
[read-only] Introduced in: | DOM 3 Core |
The type information associated with this attribute.
While the type information contained in this attribute is guarantee to be correct after loading the document or invoking Document.normalizeDocument(), schemaTypeInfo may not be reliable if the node was moved.
public function get schemeTypeInfo():TypeInfo
See also
DOM 1 Core specified | property |
specified:Boolean
[read-only] [override] Introduced in: | DOM 1 Core |
True if this attribute was explicitly given a value in the instance document, false otherwise.
If the application changed the value of this attribute node (even if it ends up having the same value as the default value) then it is set to true. The implementation may handle attributes with default values from other schemas similarly but applications should use Document.normalizeDocument() to guarantee this information is up-to-date.
public function get specified():Boolean
See also
<script> function fnFindSpecified(){ var oAttributes=oList.attributes; alert(oAttributes(0).nodeName); for(var i=0;i<oAttributes.length;i++){ var oNode=document.createElement("LI"); var oNodeValue=document.createTextNode(i + " " + oAttributes(i).nodeName + " = " + oAttributes(i).nodeValue); oList.appendChild(oNode); oNode.appendChild(oNodeValue); if(oAttributes(i).nodeValue!=null){ alert(oAttributes(i).nodeName + " specified: " + oAttributes(i).specified); } } } </script> <ul id=oList onclick="fnFindSpecified()"> <li>Click to Find Specified Attributes</li> </ul>
DOM 1 Core value | property |
value:DOMString
Introduced in: | DOM 1 Core |
On retrieval, the value of the attribute is returned as a string. Character and general entity references are replaced with their values.
On setting, this creates a Text node with the unparsed contents of the string, i.e. any characters that an XML processor would recognize as markup are instead treated as literal text.
Note (IE8): Internet Explorer 8 or later. In IE8 mode, the value property is correctly reported as a canonical attribute name. For example, <input type="text" readonly> and <input type="text" readonly="readonly"> would both set the input text field to read-only. In IE8 mode, the value is evaluated as a cannonical value, "readonly". In earlier document compatibility modes, it is evaluated as a Boolean value, true.
public function get value():DOMString
public function set value(value:DOMString):void
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised when
the node is readonly.
|
See also
DOMNodeInserted | Event |
dom.events.MutationEvent
DOMNodeInserted
A node has been added as a child of another node or, in case of Attr nodes, has been added to an Element. This event is dispatched after the insertion has taken place. The target node of this event is the node being inserted.
DOMNodeInsertedIntoDocument | Event |
dom.events.MutationEvent
DOMNodeInsertedIntoDocument
A node has been inserted into a document, either through direct insertion of the node or insertion of a subtree in which it is contained; Attr nodes are considered part of an Element's subtree. This event is dispatched after the insertion has taken place. The target node of this event is the node being inserted. If the node is being directly inserted, the event type DOMNodeInserted occurs before this event type.
DOMNodeRemoved | Event |
dom.events.MutationEvent
DOMNodeRemoved
A node is being removed from its parent node or, in case of Attr nodes, removed from its ownerElement. This event is dispatched before the removal takes place. The target node of this event is the node being removed.
DOMNodeRemovedFromDocument | Event |
dom.events.MutationEvent
DOMNodeRemovedFromDocument
A node is being removed from a document, either through direct removal of the node or removal of a subtree in which it is contained; Attr nodes are considered part of an Element's subtree. This event is dispatched before the removal takes place. The target node of this event type is the node being removed. If the node is being directly removed, the event type DOMNodeRemoved occurs before this event type.
DOMSubtreeModified | Event |
dom.events.MutationEvent
DOMSubtreeModified
This is a general event for notification of all changes to the document. It can be used instead of the more specific mutation and mutation name events listed below. It may be dispatched after a single modification to the document or, at the implementation's discretion, after multiple changes have occurred. The latter use should generally be used to accommodate multiple changes which occur either simultaneously or in rapid succession. The target of this event is the lowest common parent of the changes which have taken place. This event is dispatched after any other events caused by the mutation(s) have occurred.