gfranko / jquery.selectBoxIt.js

A jQuery Select Box Plugin for Mobile, Tablet, and Desktop
http://www.selectboxit.com
MIT License
852 stars 301 forks source link

add() methods with HTML strings #325

Open bluesky88 opened 9 years ago

bluesky88 commented 9 years ago

Hi, I am just trying using the add() methods with HTML strings which is same with the example HTML strings from populate options like below, however it still not able to read it! The reason to use HTML string is to display the label when populate the list.

Example HTML strings from populate, // Populates the drop down using a JSON array populate: '< option value="SelectBoxIt is:" >SelectBoxIt is:</ option >' + '< option value="a jQuery Plugin" >a jQuery Plugin</ option >' + '< option value="a Select Box Replacement" >a Select Box Replacement</ option >' + '< option value="a Stateful UI Widget" >a Stateful UI Widget</ option >'

Example HTML string will use to populate,

'< optgroup label="Japan" >'+'< option value="tokyo" >Tokyo</ option >' + '</ optgroup >' + '< optgroup label="Indonesia" >'+ '< option value="bali" >Bali</ option >' + '< option value="Jakarta" >Jakarta</ option >' + '</ optgroup >'

How to populate new drop down with HTML strings using add() method? Thank you so much.