🔸attribute
🚧 under construction
🔰 JS ⟩ browser ⟩ DOM ⟩ types ⟩ Element ⟩ attribute
HTML attributes are not case sensitive, but JavaScript property names are.
HTML attributes are usually strings with exceptions:
when attribute is a boolean or numeric value.
event handler attribute is function or null.
convert HTML attribute name to JS property name:
HTML attribute JS property
--------------------------------------------
data-first-name="" elem.dataset.firstName // "data-" attribute
HTML attribute JS property
--------------------------------------------
class="" elem.className, elem.classList
for="" label.htmlFor
value="" input.defaultValue // `input.value`: user's current input
--------------------------------------------