$(this).parent(); // 父节点 $(this).parents(); // 全部父节点 $(this).children(); // 全部子节点 $(this).find(); // 返回父元素中的子元素 $(this).contents(); // 返回元素里面的所有内容,包括节点和文本 $(this).prev(); // 上一个兄弟节点 $(this).prevAll(); // 之前所有兄弟节点 $(this).next(); // 下一个兄弟节点 $(this).nextAll(); // 之后所有兄弟节点 $(this).siblings(); // 所有兄弟节点
eq 使用方法:
$(this).next().eq(2).val(); //右边第3个兄弟元素表单的值;
Jquery 获取元素(父节点、子节点、兄弟节点)方法
最新推荐文章于 2022-07-07 00:08:51 发布