jquery - Bootstrap 3 Selectbox - Clickable only on Arrow -


i using bootstrap selectbox. reason, have use selectpicker inside anchor tag , restrict clicking on entire button , should clickable on arrow? on clicking on dropdown arrow, list visible. other places have ignore click event.

please check fiddle

<a href="#">     <select class="selectpicker" data-live-search="true">         <option>mustard</option>         <option>ketchup</option>         <option>relish</option>         <option>plain</option>         <option>steamed</option>         <option>toasted</option>     </select> </a> 
$('.selectpicker').selectpicker(); 

you can try adding workaround!!

demo here

$('button.dropdown-toggle').on('click',function(e){     if($(e.target).attr('class')!="caret")     {         e.stoppropagation();     } }); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -