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

后端 未结 7 553
感情败类
感情败类 2021-02-04 03:53

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\")

相关标签:
7条回答
  • 2021-02-04 04:19

    The first one will get all divs descendant of #mainblock. The second one will get all divs that are immediate children of #mainblock

    0 讨论(0)
提交回复
热议问题