behavior:check

behavior:check

Standard checkbox button implementation. Can be applied to any element to toggle :checked state on it.

Elements

that have this behavior applied by default:

  • <input type="checkbox"> – standard HTML inline checkbox button;
  • <button type="checkbox"> – Windows like inline checkbox button, use it as <button type=checkbox >caption</button>.

Attributes

that this behavior knows about:

  • checked – if provided will initialize value of runtime state of the flag checked.
  • name="name" – standard attribute name – name of the input element on a form.
  • value="..." – standard value attribute (used by behavior:form).

Events

Together with the standard set of events (mouse, keyboard, focus) behavior: radio generates:

  • BUTTON_STATE_CHANGED event – the button just changed its state to checked. Asynchronous event.
  • BUTTON_PRESS event – mouse down or spacebar key down when button is in focus. Synchronous event.

Value

true/false, reflects current status of :checked state flag.

Methods

N/A – behavior:button does not introduce any specific methods.