<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 に答える