The Bootstrap-Nice-Select plugin displays data in a modern format, via data attributes or JavaScript.
Via data attributes
For pre-selecting options you can use selected="selected" or for multiple select, you can use multiple="multiple" or just multiple.
You can even use <optgroup> tags to render options in a group and search for group texts in the items search overlay field.
Currently, remote URL data is only supported through the initialization through JavaScript but the support for data attributes will be added in the upcoming release.
The <select> data is now supported for remote URL data through the initialization with a data attribute or via JavaScript.
Via JavaScript
Call a bootstrap-nice-select field with an id or class.
For setting available options, create a javascript object and append it to the initialization. You can set something like the locale option, the scrollable feature or many more.
For using remote URL data, give the option searchData the function name you created or a callback function and return the data in JSON format. When using remote URL data, predefined options
which are not already selected="selected" are ignored but the select field need to be HTML conform, if your JSON data is using <optgroup> tags or other available data options.