jquery - appendTo does not work on ajaxForm in success: -
i want append quest1 #adder, not happen
$('#formnam').ajaxform(function() { var quest = $('#text').attr('value'); var quest1 = '<div>'+$('#text').attr('value')+'</div>'; $.ajax({ type: "post", url: "submit.php", data: "q="+quest, success: function() { $('#adder').html(quest1); } }); });
it works if use .text or .html, want appendto.
does not work on chrome, ie, ff
thanks jean
.html()
indeed overwrite html content #adder
. if want append new stuff, use .append()
instead.
Comments
Post a Comment