# select **Repository Path**: mirrors_dequelabs/select ## Basic Information - **Project Name**: select - **Description**: modern, accessible `. #### .blur() Blur ``. #### .highlight(name) Highlight an option by `name`. When an option is in "highlight" mode, it will be selected when the user hits enter. #### .dehighlight() De-highlight "highlight"ed option #### .get(name) Get an option with `name`. #### .show([name]) Show the dropdown or option `name`. #### .hide([name]) Hide the dropdown or option `name`. #### .visible([name]) Check if option `name` or dropdown are visible. #### .toggle([name]) Toggle `.show([name])`, `.hide([name])`. #### .disable(name) Disable an option `name`. #### .enable(name) Enable an option `name`. #### .selected([options]) Get / set selected options. #### .values() Get selected values. #### .search(term) Search options with `term`, if there are listeners for `search` event, the `.search()` method will do nothing. this allows you to set up custom search. var select = Select() .add('one') .add('two') .on('search', function(term){ ajax(term, function(opts){ opts.forEach(select.add, select); select.highlight(opts[0].name); }) }) ### Events #### "add" Emitted when you add an `option` with an object: { name: value: el: selected: } #### "remove" Emitted when an option is removed, `option` object is given as an argument. #### "select" Emitted when an option is selected. { name: value: el: selected: } #### "change" Emitted with `Select` instance. #### "deselect" Emitted with an `option` object. #### "show" Emitted when the select dropdown is shown. #### "hide" Emitted when the select dropdown is hidden. #### "search" Emitted when `.search(term)` is called, if there are listeners the method `.search(term)` will do nothing. #### "found" Emitted after a search was performed with number of matches. ### Tests ```bash $ make test ``` ## License MIT