Such as:
<li><input type="radio" name="zt" value="1"></li>
<li><input type="radio" checked="checked" name="zt" value="2"></li>
<li><input type="radio" name="zt" value="3"></li>
The value of the name attribute must be the same. Next, js is used to get the selected value:
var zt = document.getElementsByName("zt");
for(var i=0;i<zt.length;i++){
if(zt[i].checked) {
alert(zt[i].value);
}
}
I’m done with a for loop.