checkbox徐州
无锡
苏州
中国
俄罗斯将复选框设置为无线电javascript部分$(function(){$(':checkbox[name=Country]').click(function(){if($(this).prop('checked')){$(':checkbox[name=Country]').prop("checked",false);$(this).prop("checked",true);}});})这样设置name属性为Country的为单选,name为city的为多选。那么如何获取选中的元素呢?获取复选框选中的内容javascript部分$(function(){varcity="";$('input:checkbox[name=city]:checked').each(function(){city+=($(this).val());});})这里需要注意的是,通过上述方法得到的内容是input标签的值。如果不给值,则获取的都是nojquery。取消勾选varcode_Values=$('input:checkbox[name=abcd]:checked');if(code_Values.length){for(vari=0;iMale女yesNo使用JavaScript获取第一组的选中值varradio=document.getElementsByName("sex_radio")for(vari=0;iHSKTOCFL使用JavaScript获取选中值$("#zh_select").change(function(){varselect=document.getElementById("zh_select");console.log(select.options[select.selectedIndex].value);})使用JavaScript改变选中的值$("#zh_select").change(function(){varselect=document.getElementById("zh_select");select.options[index].selected=true;index:option的位置,从0开始})$("#zh_select").find("option:contains('"+HSK+"')").attr("selected",true);