I putted the whole thing in a div and now it seems to work : $(document).ready(function(){
$("form#chatform").submit(function(){ $test = '<div id="TE"><input name="test" type="checkbox" value="1">'; $("#messagewindow").prepend($test+"<b>"+$("#msg").val()+"</b></ div>"); $("#TE").click(function () { alert('test'); }); return false; }); });