HTML代码 复代码 代码如下: 1 2 3 4 통신Type获得RadioButtonList적값 A B C D 통신이름获得Radio的Value A B C D 통신이름获得CheckBox적값 전부 反选 A1 A2 A3 A4 获得Multiple的Value 添加 移除 B1 B2 B3 B4 获得Select的Value 添加 移除 jQuery代码 复代码 代码如下: <br>$(document).ready(function () { <br>//获得RadioButtonList적값 <br>$("#btnGetRadioButtonListValue").click(function () { <br>if ($("input[ type=radio]:checked").val() == null) { <br>alert("请选择"); <br>return false; <br>} <br>alert($("input[type= radio]:checked").val()); <br>}); <br>//获得Html적 라디오의 값 <br>$("#btnGetRadioValue").click(function () { <br>if ($("input[name='radioSelect']:checked").val() == null) { <br>alert("请选择") <br>return false <br>} <br>alert; ($("input[name='radioSelect']:checked").val()); <br>//获得CheckBox적값 <br>$("#btnGetCheckBoxValue").click( function () { <br>var 값 = ""; <br>$("input[name='chkSelect']").each(function () { <br>if ($(this).attr("checked) ")) { <br>values = $(this).val() ","; <br>} <br>}); <br>if (values == "") { <br>alert("请选择"); <br> false 반환; <br>} <br>values = value.substring(0, value.length - 1); //去掉尾부, <br>alert(values); <br>}) ; <br>//전체 <br>$("#btnSelectAllOn").click(function () { <br>$("input[name='chkSelect']").each(function () { <br>$(this).attr("checked", true); <br>}); <br>}); <br>//返选 <br>$("#btnSelectAllOff").click(function () { <br>$("input[name='chkSelect']").each(function () { <br> $(this).attr("확인됨", false) <br>}) <br>}); <br>//获得Multiple的值 <br>$("#btnGetMultipleValue").click(function () { <br>var value = ""; <br>$("#multiple1 option:selected").each (function () { <br>values = $(this).val() ","; <br>}) <br>values = value.substring(0, value.length - 1) //去掉尾부, <br>경고(값) <br>}); <br>//添加MultipleOption <br>$("#btnAddMultipleOption").click(function () { <br>$("#multiple1").append("<option value='AX'> AX</옵션>"); <br>}); <br>//移除Multiple所选Option <br>$("#btnRemoveMultipleOption").click(function () { <br>$("#multiple1 option").remove("option:selected"); <br>}); <br>//获得Select 值 <br>$("#btnGetSelectValue").click(function () { <br>alert($("#select1 option:selected").val()); <br> }); <br>//添加SelectOption <br>$("#btnAddSelectOption").click(function () { <br>$("#select1").append("<option value='BX'> BX</옵션>"); <br>}); <br>//移除Select所选Option <br>$("#btnRemoveSelectOption").click(function () { <br>$("#select1 option").remove("option:selected"); <br>}); <br>}); <br>