Using axes

//ul/li                       # ul > li
//ul/child::li                # ul > li (same)
//ul/following-sibling::li    # ul ~ li
//ul/descendant-or-self::li   # ul li
//ul/ancestor-or-self::li     # $('ul').closest('li')

// ul /child:: li
Axis Step Axis Step
Steps of an expression are separated by /, usually used to pick child nodes. That's not always true: you can specify a different "axis" with ::.
Comments