DOM Traversing Examples

All Javascript code and CSS code are inserted at the top of the page. Below are all HTML markup being modified via jQuery.

Use of next()

First TD Second TD highlight the next! Third TD I got highlighted ;D

Use of nextAll()

First TD Second TD highlight-blue everyone after me! Third TD I got highlighted ;D Fourth TD me too \o/

Use of nextAll() and andSelf()

First TD Second TD highlight-green everyone after me and myself! Third TD I got highlighted ;D Fourth TD me too \o/

Use of parent()

Item 1
Item 2
Item 3

Use of children()

Category 1
Category 2
Category 3

Use of children() with a selector

Product 1
Product 2
Product 3

Use of siblings()

Post 1
Post 2
Post 3