rvera / image-picker

Image Picker is a simple jQuery plugin that transforms a select element into a more user friendly graphical interface.
http://rvera.github.com/image-picker
Other
906 stars 216 forks source link

How to select an item with js #7

Closed FelixNikolaus closed 11 years ago

FelixNikolaus commented 11 years ago

Hi, Im sure its possible but I cant find it. How can I select en Item with js? And btw how can i add an item?

Thanks a lot!! Felix

rvera commented 11 years ago

To select an item it's pretty straightforward js.

$("select").val("new_value")

Then to sync the picker with the actual select element just call

$("select").data("picker").sync_picker_with_select()