Link to home
Start Free TrialLog in
Avatar of jackjohnson44
jackjohnson44

asked on

jquery insert item into bottom of a div

I have a document like this

<div id="menu"></div>

<div class="itemplate"></div>  //This is what I am cloning and moving

I want to put items into the menu, so
<div id="menu">
   <div id="item_1"></div>
   <div id="item_2"></div>
</div>


I want to insert an item into the last position inside the menu.  The menu could start off blank.

I can successfully keep inserting items after somethign, but that is not what I want to do.
var newlyInsertedDiv = $("#template").clone().insertAfter($(".menu"));
newlyInsertedDiv.attr("id", "item_" + counter);


How do I make it so I can insert my cloned div into the last position inside menu?
ASKER CERTIFIED SOLUTION
Avatar of alien109
alien109
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial