XML DOM isId Property
Attr object
Definition and Usage
The isId property returns true when the attribute is of type ID (for example, it contains the identifier of the element it belongs to), otherwise it returns false.
Syntax
attrObject.isId
Example
The following code snippet uses loadXMLDoc() to load "books.xml" Load into xmlDoc, and return whether the category attribute is the
Example
xmlDoc
=
loadXMLDoc
(
"
books.xml
"
)
;
x
=
xmlDoc
.
getElementsByTagName
(
'
book
'
)
;
for
(
i
=
0
;
i
<
x
.
length
;
i
++
)
{
document
.
write
(
x
.
item
(
i
)
.
attributes
[
0
]
.
isId
)
;
document
.
write
(
"
"
)
;
}
The code above will output:
false
Try it »
Attr object