Hi,
I have nested elements like below,
<div>
<p>Hello Again</p>
<p class="selected"></p>
</div>
<div>
<p>Hello Again</p>
<p class="selected"></p>
</div>
<div>
<p>Hello Again</p>
<p class="selected"></p>
</div>
I want to add text in the ‘selected’ paragraph in the second div,
<script>$("div:first").next('.selected').text("selected");</script>
it won’t work at all. please let me know if you have any ideas.
Many thanks,
Lau