87,917
社区成员
发帖
与我相关
我的任务
分享
$('select').val('黑体');
$('input[name="sex"][value="normal"]').attr('checked', true);
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js"></script>
<select multiple>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<input type="radio" value="bold" name="sex"/>加粗
<input type="radio" value="normal" name="sex"/>不加粗
<script>
$('select').val([1, 2]); //多选传递数组选中多个,单选为字符串,注意jquery版本
$('input[name="sex"][value="normal"]').attr('checked', true);
</script>