jquery常用

//查找name='box'的checkbox未选中个数
$("input[name='box']").not("input:checked").length; 
//查看当前元素父节点同级所有显示元素
$(this).parent("span").siblings(":visible"); 
//取得radio选中值
$("input[name='radio']:checked").val();
//设置选中
$(this).attr("checked",false); 
//设置下拉值等于'1'的选中
$("select[name=''] option[value='1']").attr("selected",true); 
$(".cs:lt(4)").show();//小于
$(".cs:eq(4)").show();//等于
$(".cs:gt(4)").show();//大于 
//ajax
$.ajax({
    url:'',
    type: 'post',
    dataType:'json', 
    async:false,
    success:function(result) {   
    
    }
}); 
//以指定字符开头
$("[id^='it']") 
//以指定字符结尾
$("[id$='it']")
//包含指定字符
$("[id*='it']") 
var step = new Array();
step.push(0);//添加
step.length = 0;//清空
step.pop();//移除最后
原文地址:https://www.cnblogs.com/fxfly/p/4726406.html