jQuery get value of selected radio button

前端 未结 27 1860
耶瑟儿~
耶瑟儿~ 2020-11-22 13:55

The problem statement is simple. I need to see if user has selected a radio button from a radio group. Every radio button in the group share same id.

The problem is

27条回答
  •  [愿得一人]
    2020-11-22 14:11

    Company Suscription: Customer Subscription: Manully Set: NO Subscription:

    and handle jquery for alert as for th e value set / Changed through div id:

    $("#subscriptions input") // select the radio by its id
        .on('change', function(){ // bind a function to the change event
        alert($('input[name="subsrad"]:checked', '#subscriptions').val());
                });
    

    it is so easy....:-}

提交回复
热议问题