Name
setIdAttribute: name, isId(3)
Synopsis
This method provides a way to mark an attribute as a
user-determined ID attribute. Although attributes that are marked
as ID attributes using this method will show up in searches
conducted using the Document.getElementById( )
method, it
will not modify any of the type information provided by the
Attr.schemaTypeInfo
attribute.
To mark namespace-aware attributes, use the setIdAttributeNS( )
method.
Arguments
- name: DOMString
The attribute name to modify.
- isId: boolean
Set to
true
if the attribute is to be an ID attribute; otherwise, set tofalse
.
Exceptions
- NO_MODIFICATION_ALLOWED_ERR
Raised if the element is read-only.
- NOT_FOUND_ERR
Raised if no attribute matching the
name
parameter is found in the attributes collection.
Java binding
public void setIdAttribute(String name, boolean isId) throws DOMException;
Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.