<select name="select-your-sporting-event" id="select-your-sporting-event" class="select">
<option>-------------</option>
<option>Cricket Packages @ Lords</option>
<option>Football Packages</option>
<option>F1 Packages</option>
<option>Moto GP Packages</option>
<option>Golf Packages</option>
<option>Tennis Packages</option>
<option>Footbal World Cup 2014</option>
</select>
问问题
45 次
1 回答
2
$(function() { // when DOM is ready
// using 'val' method
$('#select-your-sporting-event').val('F1 Packages');
// using 'prop' method
$('#select-your-sporting-event option:contains(F1 Packages)').prop('selected', true);
// using 'eq' method
$('#select-your-sporting-event option').eq(3).prop('selected', true);
})
于 2013-01-07T07:34:56.933 回答