var div1 = $("<div>");
var div2 = $("<div>");
var div3 = $("<div>");
$('#container').html('').append(div1).append(div2).append(div3);
What is the best way to do this? Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is nothing wrong with what you are doing, but if you don’t need references to the elements you could just as well do:
Edit
You could do something like below to make the statement more terse without any real benefit.