<input name="sex" type="radio" value="" checked="checked" /><input name="sex" type="radio" value="" />女

获得radion的值:

   var sex = $("input[name=sex]:checked").val();

设置radion的值

  //设置性别
            if (sex=='') {
                $("input[name=sex]:eq(0)").prop("check", true);
            } else {
                $("input[name=sex]:eq(1)").prop("check", true);
            }

prop设置或返回当前jquery对象所匹配的元素的属性值

相关文章:

  • 2021-05-17
  • 2022-12-23
  • 2022-02-27
  • 2021-11-28
  • 2022-01-09
  • 2021-04-07
  • 2021-06-19
  • 2021-11-15
猜你喜欢
  • 2021-05-31
  • 2021-12-13
  • 2021-11-30
  • 2021-12-31
  • 2021-11-24
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案