Basically i tried this:
var newDiv = $('#parentDiv').append("<div id=\""+user_name+"\" div class=\"user_head\">"+"</div>");
But when I try to append to the newDiv, it appends to the #parentDiv.
How can i declare a variable for the new DIV created from append?
You can use appendTo and switch the order of the selectors:
var newDiv = $("<div id=\""+user_name+"\" div class=\"user_head\">"+"</div>").appendTo("#parentDiv")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With