jquery 元素查找同级 父级
遍历节点
$(this).parent() //取到当前元素的父级
$(this).parent().next() //取到父元素的同级元素
$("selector").children()
获取匹配元素的子元素集合,以数组返回(只考虑子元素,不考虑子元素以下的后代元素)
$("selector").prev()
获取匹配元素前面紧邻的同辈元素
$("selector").siblings()
获取匹配元素前后所有的同辈元素
$(this).parent().next().find("tbody[id^='list_']").hide(); //id 以list_开头的
$("input[id^='code']");//id属性以code开始的所有input标签
$("input[id$='code']");//id属性以code结束的所有input标签
$("input[id*='code']");//id属性包含code的所有input标签
$("input[name^='code']");//name属性以code开始的所有input标签
$("input[name$='code']");//name属性以code结束的所有input标签
$("input[name*='code']");//name属性包含code的所有input标签
$("input[name*='code']").each(fuction(){
var sum=0;
if($(this).val()!=""){
sum=parseInt(sum)+parseInt($(this).val());
}
$("#").text(sum);
})jQuery的选择器中的通配符 http://www.jb51.net/article/76917.htm
相关推荐
开心就好 2020-06-10
80437916 2020-05-07
TLROJE 2020-10-26
echoes 2020-08-20
nercon 2020-08-01
zhanghaibing00 2020-06-28
Aveiox 2020-06-25
henryzhihua 2020-06-21
zhoutaifeng 2020-06-17
liangzhouqu 2020-06-16
TONIYH 2020-06-11
x青年欢乐多 2020-06-06
KyrieHe 2020-06-03
bertzhang 2020-06-02
haokele 2020-05-29