Does anyone know how to set the first option value of a select using jquery? For example i have the following select tag.
<select id = "my-id">
<option value=""></option>
</select>
I want to set the value. So far I have unsuccessfully attempted the following.
$("select#my-id").first().val("hello world");
document.getElementById('my-id').value="hello world";
$("select#my-id option")
.each(function() {
this.text = query.eguide;
this.value =query.eguide;});