In jQuery, how do I get the value of a radio button when they all have the same name?

前端 未结 7 895
[愿得一人]
[愿得一人] 2020-11-28 04:44

Here is my code:

Sales Promotion
相关标签:
7条回答
  • 2020-11-28 05:08

    There is another way also. Try below code

    $(document).ready(function(){
    
          $("input[name='gender']").on("click", function() {
                alert($(this).val());
            });
    });
    
    0 讨论(0)
提交回复
热议问题