Trying to get a value of 3 What am I doing wrong with my jQuery?
JQuery
$('select[name="clauses"]').find("option[text~='OR']").val()
HTML:
<select multiple="" name="clauses" > <option value="0"> </option> <option value="1"> ( </option> <option value="2"> ( Someone</option> <option value="3"> OR Something ) )</option> <option value="4">AND Something</option> </select>
I used ~ because maybe I need to find the word Someone, for example.
EDIT: Thank you all for your quick answers. Unfortunately, I have to mention only 1
viper source share