Home > Article > Web Front-end > How to determine whether a radio button is selected in jquery
Jquery method to determine whether a radio button is selected: 1. Use the checked attribute to determine whether it is selected. The code is [if ($(this).attr("checked")) {alert("checked"); }]; 2. jquery gets the value of the radio button.
The operating environment of this tutorial: windows7 system, jquery3.2.1 version, Dell G3 computer.
Recommended: jquery video tutorial
Jquery method to determine whether the radio button is selected:
1. Use the checked attribute to judge the selection
radio cannot be judged by "checked" equality, only true is used to judge
The code is as follows: