setAttributeNode method
Sets an attribute object node as part of the object.
![]() |
Syntax
object.setAttributeNode(pattr, ppretAttribute)Parameters
- pattr [in]
-
Type: IHTMLDOMAttribute
attribute object to be assigned. - ppretAttribute [out, retval]
-
C++ Address of a pointer variable that receives the assigned IHTMLDOMAttribute2 pointer. JavaScript Returns a reference to the removed attribute object.
Return value
Type: IHTMLDOMAttribute
Returns a reference to the removed attribute object.Address of a pointer variable that receives the assigned IHTMLDOMAttribute2 pointer.Exceptions
| Exception | Condition |
|---|---|
|
Raised if pattr was created from a different document than the calling element's parent document. Versions earlier than Internet Explorer 10 will throw the exception as WRONG_DOCUMENT_ERR. |
|
Raised if a read only attribute already exists with the same name as pattr. Versions earlier than Internet Explorer 10 will throw the exception as NO_MODIFICATION_ALLOWED_ERR. |
|
Raised if pattr is already assigned to an element object. Versions earlier than Internet Explorer 10 will throw the exception as INUSE_ATTRIBUTE_ERR. |
Standards information
Remarks
setAttributeNode was introduced in Microsoft Internet Explorer 6.
See also
- a
- abbr
- acronym
- address
- applet
- area
- b
- base
- baseFont
- bdo
- bgSound
- big
- blockQuote
- body
- br
- button
- caption
- center
- cite
- code
- col
- colGroup
- comment
- custom
- dd
- del
- dfn
- dir
- div
- dl
- dt
- em
- embed
- fieldSet
- font
- form
- frame
- frameSet
- head
- hn
- hr
- html
- i
- iframe
- img
- input type=button
- input type=checkbox
- input type=email
- input type=file
- input type=hidden
- input type=image
- input type=number
- input type=password
- input type=radio
- input type=range
- input type=reset
- input type=search
- input type=submit
- input type=tel
- input type=text
- input type=url
- ins
- isIndex
- kbd
- label
- legend
- li
- link
- listing
- map
- marquee
- menu
- nextID
- noBR
- noFrames
- noScript
- object
- ol
- option
- p
- plainText
- pre
- q
- rt
- ruby
- s
- samp
- script
- select
- small
- span
- strike
- strong
- style
- sub
- sup
- table
- tBody
- td
- textArea
- tFoot
- th
- tHead
- title
- tr
- tt
- u
- ul
- var
- wbr
- xml
- xmp
