l-zl
jQuery 根据value设置radio默认选中:

HTML:
<input type="radio" name="type" value="1" checked=""> 132 <input type="radio" name="type" value="2">456 JS: var sex = 2; $(":radio[name=\'rbsex\'][value=\'" + sex + "\']").prop("checked", "checked");

 

分类:

技术点:

相关文章: