1.jquery如何添加class样式
$(obj).parents("td").addClass("has-error");
2.jquery怎么获取父节点
$(obj).parents("td")
3.具有 true 和 false 两个属性的属性,如 checked, selected 或者 disabled 使用prop(),其他的使用 attr();
多次切换attr("checked",true)时: 首次切换没问题,再次切换无效果,使用prop,问题解决。
转载自:https://www.cnblogs.com/lizi-cat/p/10811743.html
$(
'div'
).each(
function
(index,domEle){
index就是索引值
domEle 表示获取遍历每一个dom对象
});