一、jquery文本框事件
1、文本框内容改变事件,可使用propertychange,例如: 
 
("#txtDataDate").bind("propertychange",function(){ 
});
2、获取被选中RadioButton 的值 
 
var radio_value = $("input[type=radio][
checked]").val();
3、下拉列表的改变事件,以及获得选中选项的值 
 
$("#下拉列表").change(function() { 
//获得选中项的值 
var select = $(this).val(); 
}).change();
二、jquery获取复选框选中值
jquery获取复选框被选中值
 
<input type="button" id="btn5" value="获得选中的所有值">
<input type="text" name="dd" id="dd" size="50"  />
$("#btn5").click(function(){
 var str="";
 $("[name='
checkbox'][checked]").each(function(){
 str+=$(this).val()+",";
  })
 $("#dd").val(str)
 })
三、jquery分别获取选中的复选框值
jquery如何分别获取选中的复选框值
 
function jqchk(){ //jquery获取复选框值 
var s=''; 
$('input[name="aihao"]:checked').each(function(){ 
s+=$(this).val()+','; 
});
点击“提交”后,可以得到正确的选择值了,但是后面多一个,(英文逗号),这个可以检测一下再用substring去除,或者获取到复选框选择值后一般都要转成数组再使用的,所以也可以在转成数组后,去除最后一个数组元素。 
 
if (s.length > 0) { 
//得到选中的checkbox值序列 
s = s.substring(0,s.length - 1); 
} 
alert(s==''?'你还没有选择任何内容!':s); 
} 
</script>
获取checkbox值的方法:将其放到数组中,然后连接成字符串 
 
var chenked=$("input[type='checkbox']:checked").val([]); 
var names = ""; 
for(var i=0;i<chenked.length;i++){ 
names += chenked[i].value +","; 
}
可以更优雅一些: 
 
var arr_v = new Array(); 
=$("input[type='checkbox']:checked").each(function(){ 
arr_v.push(this.val()); 
}); 
arr_v.join(','); 
 
就可以了。
例子:
 
//此为重点,该句与下面的第一句效果一样 
var selectedItems = new Array(); 
$("input[@name='itemSelect[]']:checked").each(function() {selectedItems.push($(this).val());});
if (selectedItems .length == 0) 
alert("Please select item(s) to delete."); 
else 
$.ajax({ 
type: "POST", 
url: "/ajax_do_something.php", 
data: "items=" + selectedItems.join('|'), 
dataType: "text", 
success: function (request) { 
document.location.reload(); 
}, 
error: function(request,error){ 
alert('Error deleting item(s), try again later.'); 
} 
} 
);
 
java 拆分:
 
String names = null; 
String name1 = null; 
String name2 = null; 
names = request.getParameter("names"); 
String[] name = names.split(","); 
for(String x : name){ 
if("zhangsan".equals(x)){ 
name1 = x; 
} 
if("lisi".equals(x)){ 
name2 = x; 
} 
}
jquery 修改时候选中 后台查询的复选框 
 
var struids='${useridstr}'; //后台获取数据 
alert(struids); 
if(struids!='') 
{ 
var str=struids.split(","); 
for(var j=0;j<str.length;j++) 
{ 
$(":checkbox[value='"+str[j]+"']").attr("checked",true); 
} 
}
下拉框 
 
var module='${module}' 
$("#module option[value='" + module + "']").attr("selected","selected");
var s = $("#parentId").find("option:selected").val();
 
四、jquery统计复选框选中数量
jquery实现统计复选框选中数量
jquery代码:
 
复制代码 代码示例:
function countNum(){ 
 //alert($('input[name=check]:checked').length); 
var arrays = new Array(); 
 var items = document.getElementsByName("check"); 
 for(var i=0;i<items.length;i++){ 
     if(items[i].checked){ 
arrays.push(items[i].value); 
     } 
 } 
 alert(arrays.length); 
        }
 
html代码:
 
复制代码 代码示例:
<input type="checkbox" value="1" name="check" checked/> 
<input type="checkbox" value="2" name="check"/> 
<input type="checkbox" value="3" name="check"/> 
<input type="button" value="选中个数" id="btn" onclick="countNum();">