programming with html() or append()
I have a question about programming style.
Which code is better and why?
- $("#testdiv").empty().append("<div>Test 123</div>");
OR
- $("#testdiv").html("<div>Test 123</div>");
?
In my case i need to clear the node before i insert it, so i would like to know which code is better or faster?