jQuery isAfter Examples

Both Elements in Same Level

[ div > p.first] I'm first

[ div > p.second] I'm second

Elements in Different HTML Depths (First is Deeper)

[ div > div > p.first] I'm first

[ div > p.second] I'm second

Elements in Different HTML Depths (Second is Deeper)

[ div > p.first] I'm first

[ div > div > p.second] I'm second

Elements in Same HTML Depth With Different Parents

[ div > div > div > p.first] I'm first

[ div > div > div > p.second] I'm second