How to select first option element from a select.
Get the value of first option:
var val-to-select = $('#selector-id').find('option:first').val();
Select it:
$('#selector-id').val(val-to-select);
Get the value of first option:
var val-to-select = $('#selector-id').find('option:first').val();
Select it:
$('#selector-id').val(val-to-select);
No comments:
Post a Comment