/ui/elements/chkbox

Exports the default chkbox element method as mapp.ui.elements.chkbox()

Methods

(inner) chkbox(params) → {HTMLElement}

The chkbox element method will create a label HTMLElement with a nested checkbox type input element.

The onchange method provided as params property will be executed if the checkbox input element is toggled.

Parameters:
NameTypeDescription
paramsObject

Parameter for the chkbox input element and label.

Properties
NameTypeAttributesDescription
params.labelstring

The string for the chkbox label span.

params.data_idstring<optional>

The string value assigned as data-id label element property.

params.onchangefunction<optional>

The method called by the input element onchange event.

params.disabledboolean<optional>

The input element is disabled.

params.checkedboolean<optional>

The checkbox input element is checked.

Returns:

Chkbox label with input element.

Type: 
HTMLElement