Closed mhordii closed 3 years ago
I believe you can use the native jQuery selected selector to solve this issue, here's an example of your case:
<select multiple="multiple" placeholder="Hello im from placeholder" class="SelectBox" required>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
<option value="bmw">BMW</option>
</select>
$('.SelectBox option:seleted')....
This is gonna return all the options selected so you can handle it however you want.
For more details about how the operator works check te link below:
@gabrfuk can u explain by 'sumo' plugin because above ur reference not working. its return all value not a single select value
$("#ddlCPT") .change(function () { var str = ""; $("#ddlCPT option:selected").each(function () { str += $(this).text() + " "; }); console.log(str) }) .trigger("change");
its return value when i was select one option as sunday sunday,monday sunday,monday,tuesday etc
You can get the select value by using:
$('#yourSelect').val();
Hi Hemant,
how i get only clicked option value in multiselect mode? This is my jsfiddle
Thanks