v0.20.230 - 7 / 5.9

prop:__

Forces the value to be assigned as a DOM property instead of an HTML attribute.

# When to use

By default pota writes to attributes. That works for most props, but some are only correctly read back from the DOM property — or don't exist as attributes at all. Use prop:name when:

  • the property and the attribute diverge after the user interacts with the element — value and checked on form controls are the usual suspects
  • you need to assign a non-string JavaScript value — srcObject on <video>, files on <input type="file">, plaintext-only contenteditable, or a custom-element property that expects an object
  • you're writing a property that has no attribute equivalent — innerText, textContent, innerHTML

# Deleting

Assigning null or undefined to a prop: sets the property to null (not undefined) — some elements (notably <progress>) break if you set their property to undefined.

# Textarea

Setting the value on a textarea

# Extended

Some special properties