Friday, January 14, 2011

Adding List Item to UI / Appending Html to control

<div id="header">
<ul class="tabs">
<li><a href="#"><span class="tab">ListItem1</span></a></li>
<li><a href="#"><span class="tab">ListItem2</span></a></li>
</ul>
</div>


To Add the new ListItem li using jQuery write as

$("#content ul li:last").append("<li><a href="#"><span class="tab">ListItem3</span></a></li>");

No comments:

Post a Comment