0
jQueryを使用して第1レベルのセクションにクラスを追加するにはどうすればいいですか?最上位レベルの子を選択する
<div id="container">
<section>
<p>...</p>
</section>
<p>
<section>
<p>...</p>
</section>
</p>
<section>
<p>...</p>
</section>
<p>
<section>
<p>...</p>
</section>
</p>
</div>
$('#container section:first-child').addClass('section');
あなたがこのようにそれを行うことができる唯一の
選択する必要があるセクションは何ですか? –