You are on page 1of 1

Attributes vs Properties

Often (but not always!), attributes are mapped to properties and


“live synchronization“ is set up.

<input id="input-1" class="input-default" value="Enter text…">

Attributes (placed in HTML code, on


const input M D N for
element tags) full ref
propertie erence of availa
s + their b
behavior le
!
1:1 mapping (+ live-sync) input.id
Properties (automatically
Different names (but live-sync) input.className added on created DOM
objects)
1:1 mapping (1-way live-sync) input.value

You might also like