Camillia
asked on
jQuery - how can I set focus to first valid element in dropdown?
I used this to set focus to first element in a dropdown
But I want to change it to set focus to first element that doesn't have display:none?
The ddl looks like this. See the first element has "display:none". I want to set it to second one, in this case. So, first one that doesn't have "display:none". It should be Jane, III in this case
$("#newSplitTrader").val($("#newSplitTrader option:first").val());
But I want to change it to set focus to first element that doesn't have display:none?
The ddl looks like this. See the first element has "display:none". I want to set it to second one, in this case. So, first one that doesn't have "display:none". It should be Jane, III in this case
<select class="k-header k-dropdown ddl-enum" id="newSplitTrader" name="newSplitTrader" tabindex="0">
<option value="1" style="display: none;">Bob Jaco</option>
<option value="2">Jane, III</option>
<option value="3" style="display: none;">Joe xxx</option>
<option value="4">Rod Jxxx</option>
<option value="5">Bria xxx</option>
<option value="6">Jeff xxx</option>
<option value="13">Inactive</option>
<option value="14" style="display: block;">RAF</option>
<option value="15">GS</option>
</select>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER