Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Sets the value of the named attribute.
Syntax
oDOMElement.setAttribute(name, value)
Note that the syntax for Visual Basic must omit the parentheses because this method does not return a value:
oDOMElement.setAttribute name, value
Parameters
- name
- String specifying the name of the attribute. If the attribute with that name already exists, its value is changed. If the attribute with that name does not exist, it is created.
- value
- Variant that supplies the value for the named attribute.
Remarks
If an attribute with the supplied name already exists, this method changes its value to the supplied value parameter. The supplied string is not parsed, so any markup is treated as literal text (such as syntax to be recognized as an entity reference), and needs to be appropriately escaped by the implementation when it is written out.
To assign an attribute value that contains entity references, the user must create a IDOMAttribute object plus any IDOMText and IDOMEntityReference objects, build the appropriate subtree, and call the setAttributeNode method.
Applies To
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.