โ๏ธattributes vs. properties
HTML attributes vs. DOM properties
๐ธ HTML attributes โ DOM propertiesโ attr-prop sync โ
HTML attributes
DOM properties
DOM properties are NOT always strings. for example:
input.checked (boolean)
div.style (CSSStyleDeclaration)
a.href is always a full URL. ( ๐๐ป See: ๐็ฏไพ )
property โ attribute sync
standard attribute changes โ auto-update property, and vice versa.
โญ๏ธ with some exceptions ( ๐๐ป ๐็ฏไพ )
Last updated
Was this helpful?