Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
.classOfDiv > aセレクターは、の直接の子孫であるタグのみを取得するため<a>、<div class="classOfDiv">コードを次のように変更する必要があります。
.classOfDiv > a
<a>
<div class="classOfDiv">
$('.classOfDiv a').length;
>直接の子孫セレクターがないことに注意してください。
>
あなたはこのようなことをすることができます:
$('.classOfDiv > [class ^= "div"] > a').length
ここでフィドルを作りました