How to get parent, child and sibling nodes in jquery

$('#id').parents(); parent node
$('#id').children(); child node
$('#id').siblings(); all siblings
$('#id').prev(); previous sibling
$('#id').prevaAll(); all sibling nodes before
The first sibling node after $('#id').next();
All sibling nodes after $('#id').nextAll();


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324528186&siteId=291194637
Recommended