Skip to content

Instantly share code, notes, and snippets.

@sabrinaluo
Last active August 29, 2015 14:11
Show Gist options
  • Save sabrinaluo/aa4ca0af76d9fedd9ab1 to your computer and use it in GitHub Desktop.
Save sabrinaluo/aa4ca0af76d9fedd9ab1 to your computer and use it in GitHub Desktop.
查找元素
//查找同级元素
$("#id").next(); // 下一个同级元素
$("#id").prev(); // 前一个
$("#id").nextAll("div"); // 所有该元素之后的同级div元素
$("#id").prevAll("div");
$("#id").prevAll("div").andSelf(); //所有该元素之前的同级div元素及该元素本身
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment