jQuery creating of new element
$("<div/>", { "class": "clickme", text: "Нажми на меня!", click: function(){ $(this).html('Спасибо.'); } }).appendTo("body");