嗨,我徘徊如何在.edit div
中的每个元素上添加类.draggable这是我的HTML:
<div class="edit" >
<h2> Some title </h2>
<a> some link</a>
<p> some paragraph </p>
<ol>
<li> some list item</li>
<li> some list item</li>
<li> some list item</li>
</ol>
</div>
我真的不知道如何抓取.edit中的每个元素并添加类.draggable。期望的效果是这样的:
<div class="edit" >
<h2 class="draggable" > Some title </h2>
<a class="draggable"> some link</a>
<p class="draggable"> some paragraph </p>
<ol class="draggable">
<li class="draggable">some list item</li>
<li class="draggable"> some list item</li>
<li class="draggable"> some list item</li>
</ol>
</div>
答案 0 :(得分:2)