jsp radio单选控件取值

来源:互联网 发布:网络助手 红米 编辑:程序博客网 时间:2024/05/22 15:22

jsp页面,子页面获取父页面选中状态值:

//子页面获取父页面radio选中的值

var test= $("input[name='temp']:checked",window.parent.document).val();

//代码示例

//checked 默认选中<input type="radio" checked="checked"  name="temp" value="0"  onclick="getPer()"/>//radio点选按钮 name需要一致  onclick需要一致<input type="radio"  name="temp"  value="1" onclick="getPer()"/>