zoukankan      html  css  js  c++  java
  • jQuery获得radio的值

    直接用例子来说明吧

    在html代码中常常用到男女等radio的操作

       <input type="radio" name="is_active" value="1" id="is_active" <?php if($tag[is_active] == 1){ echo 'checked'; }?>>已审核
      <input type="radio" name="is_active" value="0" id="is_active" <?php if($tag[is_active] == 0){ echo 'checked'; }?>>未审核

    用jQuery获取选中的radio的值怎么做那?

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

    这样就可以了

    Meet so Meet. C plusplus I-PLUS....
  • 相关阅读:
    zju 2886
    zju 2478
    UVA350-水题
    UVA699-落叶-二叉树
    UVA327
    UVA548
    java环境变量
    synchronized关键字
    uva297
    UVA196
  • 原文地址:https://www.cnblogs.com/iplus/p/4490060.html
Copyright © 2011-2022 走看看