I have a jQuery EasyUI combobox on a page like this:
<select id="subject_selection" class="easyui-combobox">
<option value="math">Math</option>
<option value="physics">Physics</option>
<option value="chemistry">Chemistry</option>
<option value="biology">Biology</option>
</select>
I'm trying to set the index of the default selected value to -1 if there is no value set, I tried to set the attribute selectedIndex
to -1 like selectedIndex="-1"
for the select
element, but that still does not work. I don't want to give the user the ability to chose and empty value in the combobox, therefore I don't want to add this:
<option value=""></option>
In my combobox. Does anybody have any idea how I can achieve this?
Thank you