hasAttributes

The hasAttributes JS Element returns true if element has attributes; otherwise false.

Syntax

element.hasAttributes()

Examples

1 · false

2 · true

attachShadow

classList

className

closest

getAttribute

getAttributeNames

getAttributeNS

hasAttribute

hasAttributeNS

id

innerHTML

insertAdjacentHTML

localName

matches

namespaceURI

outerHTML

prefix

removeAttribute

removeAttributeNS

setAttribute

setAttributeNS

shadowRoot

slot

tagName

toggleAttribute

Web Hypertext Application Technology Working Group (WHATWG)

Home Menu