id

The id JS Element returns the value of element’s id content attribute. Can be set to change it.

Syntax

element.id [ = value ]

Examples

1 · get

2 · set

attachShadow

classList

className

closest

getAttribute

getAttributeNames

getAttributeNS

hasAttribute

hasAttributeNS

hasAttributes

innerHTML

insertAdjacentHTML

localName

matches

namespaceURI

outerHTML

prefix

removeAttribute

removeAttributeNS

setAttribute

setAttributeNS

shadowRoot

slot

tagName

toggleAttribute

Web Hypertext Application Technology Working Group (WHATWG)

Home Menu