Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

setAttributeNode method

Sets an attribute object node as part of the object.

Document Object Model (DOM) Level 3 Core Specification, Section 1.4

 

Syntax

object.setAttributeNode(pattr, ppretAttribute)

Parameters

pattr [in]

Type: IHTMLDOMAttribute

attribute object to be assigned.

Return value

Type: IHTMLDOMAttribute

Returns a reference to the removed attribute object.

Exceptions

ExceptionCondition
WrongDocumentError
4

Raised if pattr was created from a different document than the calling element's parent document. Versions earlier than a Windows Store app using JavaScript will throw the exception as WRONG_DOCUMENT_ERR.

NoModificationAllowedError
7

Raised if a read only attribute already exists with the same name as pattr. Versions earlier than a Windows Store app using JavaScript will throw the exception as NO_MODIFICATION_ALLOWED_ERR.

InUseAttributeError
10

Raised if pattr is already assigned to an element object. Versions earlier than a Windows Store app using JavaScript will throw the exception as INUSE_ATTRIBUTE_ERR.

 

Standards information

See also

a
abbr
address
area
b
base
bdo
bgSound
blockQuote
body
br
button
caption
cite
code
col
colGroup
comment
custom
dd
del
dfn
div
dl
dt
em
embed
fieldSet
form
frame
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
kbd
label
legend
li
link
map
menu
object
ol
option
p
pre
q
rt
ruby
s
samp
script
select
small
span
strong
style
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
title
tr
u
ul
var

 

 

Show:
© 2015 Microsoft