Tom Tom - 2 years ago 99
Javascript Question

What is the difference direct descendent (>) vs. descendant in jQuery selectors?

What's the difference between these two jQuery statements? They seem to do the same thing by getting all the children div tags.

$("#mainblock div")




$("#mainblock > div")

Answer Source

$("#mainblock > div") = the childs only level

$("#mainblock div") = all the childs+ desendents.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download