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().ins ertAfter($ (".menu")) ;
newlyInsertedDiv.attr("id" , "item_" + counter);
How do I make it so I can insert my cloned div into the last position inside menu?
<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().ins
newlyInsertedDiv.attr("id"
How do I make it so I can insert my cloned div into the last position inside menu?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.