idmust be unique! you create multiple divs with the same testid => INVALID HTML
, DOM, , , <div> resizable draggable:
$("#button1").click(function(){
$("<div/>", {
"class": "test",
text: "",
}).resizable().draggable()
.appendTo("body");
});
id - :
var counter = 1;
$("#button1").click(function(){
$("<div/>", {
"class": "test" + (counter++),
text: "",
}).resizable().draggable()
.appendTo("body");
});
#id docs:
id . , , , DOM. ; , , .