Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Creates an element node using the specified name.
Syntax
objDOMElement = oDOMDocument.createElement(tagName)
Parameters
- tagName
- String specifying the name for the new element node. The name is case sensitive. This name is subsequently available as the element node's nodeName property.
Returns
Object. Returns the IDOMElement object for the new element.
Remarks
Although this method creates the new object in the context of this document, this method does not automatically add the new object to the document tree. In other words, although the ownerDocument property of the new node points to this document object, the parentNode property is set to NULL. You must explicitly call one of the node insert methods—insertBefore, replaceChild, or appendChild—to add the new object.
The nodeType has the value NODE_ELEMENT.
Note that you cannot specify the namespace within the tagName parameter. If the tagName is specified in the form "xxx:yyy", the special meaning of the colon character is ignored and the colon is treated simply as a character within the tagName, creating an element with the base name "xxx:yyy" in the namespace of the document. The nameSpace property, which contains the namespace URI (universal resource identifier), is set to the empty string, "". You can only create a namespace-qualified node using the IXMLDOMDocument object's createNode method.
Applies To
See Also
IDOMElement
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.