Count immediate child div elements using jQuery

后端 未结 12 2305
无人共我
无人共我 2020-11-28 01:19

I have the following HTML node structure:

<
12条回答
  •  无人及你
    2020-11-28 02:02

    var n_numTabs = $("#superpics div").size();
    

    or

    var n_numTabs = $("#superpics div").length;
    

    As was already said, both return the same result.
    But the size() function is more jQuery "P.C".
    I had a similar problem with my page.
    For now on, just omit the > and it should work fine.

提交回复
热议问题