您的位置:首页 > Web前端 > JQuery

Jquery 获取select,option,radio选中对象与值(不断更新中)

2014-05-13 14:51 746 查看
1、页面加载时根据值自动选中。

$("#bookLevel option[value='${textbook.bookLevel}']").attr("selected",true);


2、获取页面radio选中的值。

$('input[name="testradio"]:checked').val();
$('input:radio:checked').val();
$('input[@name="testradio"][checked]');
$('input[name="testradio"]').filter(':checked');


以上name或id需要替换成你定义的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: