Home > Article > Web Front-end > jquery radio operation code_jquery
//Set the second one as selected
//if(<%=rows["sex"]%>=="2"){$(':radio[name=sex]' ).eq(1).attr('checked',true);}
//Design value=2 to be in the selected state
//if(<%=rows["sex"] .ToString() %>=='2'){$("input[name='sex']").attr("checked",'2');}
if (<%=rows["sex"]%>=="2"){$("input[name=sex][value=2]").attr("checked",true);}
I did something NB today and none of the above three conditions worked. The reason is that the local database has been operating on the remote database.
JQuery gets radio