用下面的HTML代碼:如何更換隻有第一個節點
<ul class="column">
<li><h2>Name</h2></li>
</ul>
<ul class="column">
<li><h2>Address</h2></li>
</ul>
<ul class="column">
<li><h2>Title</h2></li>
</ul>
我怎麼能只更換第一<h2>
之間的文本?
我想:
$(".column").first("h2").html("Replacing Name for another name");
但這並不作品。
有沒有想法?
你說的 「不工作」 是什麼意思? –