javascript - clearing div content through php and ajax -
echo '<script type="text/javascript" src="../jquery.js" src="../play.js"> $("#txtcreatureinfo").remove(); </script>';
i wondering why id not working. have line in php file , need remove text inside div . using ajax , all.
if want remove text inside div, cannot use .remove(). .remove() delete element. instead should use .html(""). clear text , not remove div.
so can write way.
echo '<script type="text/javascript">$("#txtcreatureinfo").html("");</script>';
Comments
Post a Comment