I use for an select tag with class='selectpicker' and id="select1",
then $('.selectpicker').selectpicker();
When I select an option, the source element (that hidden) does not set "selected" to relate option, so I dont know how to get the value/text of selected item.
try jQuery val()
I tried but value is "undefined". See here: http://jsfiddle.net/spyhunter88/dxJkX/
@spyhunter88, try this: http://jsfiddle.net/5Gncw/
var val = $('.selectpicker').val();
Sorry, I made dummy mistake in id with dot ('.'), Thanks.
Most helpful comment
@spyhunter88, try this: http://jsfiddle.net/5Gncw/
var val = $('.selectpicker').val();