美文网首页
jquery选择select

jquery选择select

作者: 給我小鱼干 | 来源:发表于2018-07-30 18:31 被阅读0次

使用jquery选择select默认选择

$("select[name="nodeNum"] option[value= ' "+data.nodeNum+" ']").prop('selected,true);

使用jquery选择select中的被选内容

$("select[name='nodeNum']" option:selected);

使用jquery选择type = radio的默认选择

$("input[name="nodeNum"] radio[value= ' "+data.nodeNum+" ']").prop('checked',true);

使用jquery选择type = radio的被选内容

$("input[name='nodeNum']:checked");
if(updateUserInfo.status == 0){
     $("#updateUserForm input[name='status']").eq(0).prop("checked",true);
  }else if(updateUserInfo.status == 1){
     $("#updateUserForm input[name='status']").eq(1).prop("checked",true);
 }

相关文章

网友评论

      本文标题:jquery选择select

      本文链接:https://www.haomeiwen.com/subject/afxqvftx.html