$('<div>') | var el = $('<div>').attr("id", "aaa").append(
$('<p>').html('toto titi').addClass("test").attr("test", "test")
).append(
$('<p>').html('toto titi').addClass("test").attr("test", "test")
).append(
$('<p>').html('toto titi').addClass("test").attr("test", "test")
).append(
$('<p>').html('toto titi').addClass("test").attr("test", "test")
);
$("body").append(el);
el.remove();
| ready |
document.createElement | var el = $(document.createElement("div")).attr("id", "aaa").append(
$(document.createElement("p")).html('toto titi').addClass("test").attr("test", "test")
).append(
$(document.createElement("p")).html('toto titi').addClass("test").attr("test", "test")
).append(
$(document.createElement("p")).html('toto titi').addClass("test").attr("test", "test")
).append(
$(document.createElement("p")).html('toto titi').addClass("test").attr("test", "test")
);
$("body").append(el);
el.remove();
| ready |
.append().find(id) | var el = $("body").append("<div id='aaa'><p class='test' test='test'>toto titi</p><p class='test' test='test'>toto titi</p><p class='test' test='test'>toto titi</p><p class='test' test='test'>toto titi</p></div>").find("#aaa").remove();
| ready |
$("<div></div>").appendTo | var el = $("<div id='aaa'><p class='test' test='test'>toto titi</p><p class='test' test='test'>toto titi</p><p class='test' test='test'>toto titi</p><p class='test' test='test'>toto titi</p></div>").appendTo($("body")).remove();
| ready |
.append().children().last() | var el = $("body").append("<div id='aaa'><p class='test' test='test'>toto titi</p><p class='test' test='test'>toto titi</p><p class='test' test='test'>toto titi</p><p class='test' test='test'>toto titi</p></div>").children().last().remove();
| ready |