欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

jquery 根据数据库值设置radio的选中 设置选中 有大用 有大大用

jsp代码:
1 <label>性  别</label>

2 <input type="radio" value="1" name="sex"/><label>男</label>

3 <input type="radio" value="2" name="sex"/><label>女</label>   

js:

1
$(":radio[name='sex'][value='" + sex + "']").prop("checked""checked");

 注:sex的值为从数据库查出,想办法接收即可。

来自  https://www.cnblogs.com/guagua-19/p/6676822.html

普通分类: