Home > Article > Web Front-end > jquery gets radio value instance_jquery
The example in this article describes the method of obtaining the radio value with jquery and is shared with everyone for your reference. The details are as follows:
Radio group radio:
Radio group radio:
Get the value of a set of radio selected items
The second element of the radio radio selection group is the currently selected value
Old version of jquery
Get jquery instance of radio value:
var_name = $("input[name='isspecialcnt']:checked").val();
//alert(var_name);
if(var_name=='1'){
$("#isspecialcntyes").show();
$("#isspecialcntno").hide();
}
if(var_name=='0'){
$("#isspecialcntyes").hide();
$("#isspecialcntno").show();
}
}
I hope this article will be helpful to everyone’s JavaScript programming design.