<html>

<head>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
</head>

<body>

    <div id="wrap">
        <input type="radio" name="payMethod" value="1" />支付宝
        <input type="radio" name="payMethod" checked value="2" />微信
    </div>

    <script>
        
        /** 获取被选中按钮的值 **/
        var val_payPlatform = $('#wrap input[name="payMethod"]:checked ').val();

        console.log(val_payPlatform);
        alert(val_payPlatform);
        
    </script>
    
</body>
</html>

 

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2022-02-26
  • 2022-12-23
  • 2021-11-21
  • 2021-11-21
  • 2022-12-23
  • 2021-05-22
猜你喜欢
  • 2021-12-07
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
相关资源
相似解决方案