Attributes

dom. Attributes

Element attributes CRUD wrapper

Constructor

new Attributes(e)

Source:
Parameters:
Name Type Description
e HTMLElement | Element | Node element

Methods

keys() → {Array.<String>}

Source:
All attribute names
Returns:
Type
Array.<String>

all() → {Object}

Source:
All attributes
Returns:
Type
Object

set(a, v) → {this}

Source:
Set attribute
Parameters:
Name Type Description
a String attribute name
v String attribute value
Returns:
Type
this

get(a) → {String}

Source:
Get attribute
Parameters:
Name Type Description
a String attribute name
Returns:
Type
String

has(a, v) → {boolean}

Source:
Has attribute
Parameters:
Name Type Description
a String attribute name
v String attribute value
Returns:
Type
boolean

remove(a)

Source:
Remove attribute
Parameters:
Name Type Description
a