setAttributeNode method

This topic has not yet been rated - Rate this topic

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
blockQuote
body
br
button
caption
cite
code
col
colGroup
comment
custom
dd
del
div
dl
dt
em
embed
fieldSet
form
head
hn
hr
html
i
iframe
img
input type=button
input type=checkbox
input type=file
input type=hidden
input type=image
input type=password
input type=radio
input type=reset
input type=submit
input type=text
ins
kbd
label
legend
li
link
map
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

 

 

Build date: 11/28/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.