combobox.js

Creates a combobox, which is an enhanced <select>


Objects

Methods

CSS classes


Combobox(defaultValue)

Creates a combobox with a value of defaultValue. Its main div is accessible as Combobox::div. Onchange callback may be set via Combobox::onchange property.

Combobox::addOption(element, textValue)

Adds a new option, represented by element with a value of textValue.

var cb = new Combobox("[choose here]");
document.body.appendChild( cb.div );
cb.addOption(someElement, "option 1");
cb.addOption(someOtherElement, "option 2");