Home Reference Source
import {Option} from 'newton-lib/src/dom/dom.js'
public class | source

Option

Extends:

DOMElement → Option

Class used to handle a checkbox (<input type="checkbox">).

Example:

// Given the following HTML checkbox:
//   <input type="checkbox" id="showPoints">
var showPoints = new Option("showPoints", function(val) {
 console.log(val);
});

Constructor Summary

Public Constructor
public

constructor(id: string, onClick: function)

Member Summary

Public Members
public

Callback function for when the checkbox changes state.

public

State of the option.

Inherited Summary

From class DOMElement
public

Stores if the element is enabled or disabled.

public

jQuery reference to the element.

public

enabled(state: boolean)

Enable or disable the DOM element.

Public Constructors

public constructor(id: string, onClick: function) source

Override:

DOMElement#constructor

Params:

NameTypeAttributeDescription
id string

HTML id of the checkbox.

onClick function

Callback function for when the checkbox changes state.

Public Members

public onClick: function source

Callback function for when the checkbox changes state. The new state of the checkbox is passed to the callback function as a parameter.

public value: boolean source

State of the option.