jquery - Javascript - clearing everything inside a div -
i have div:
<div id="socialuserlist"> //some content here, htmltags, text, etc. </div>
now, want inside of div wiped out. trying this:
$("#socialuserlist").innerhtml = '';
but reason doesn't want work. why?
the normal javascript method:
document.getelementbyid('socialuserlist').innerhtml = '';
in jquery:
$('#socialuserlist').html('');
pure javascript , jquery go hand in hand, so:
from pure javascript jquery:
var socialuserlist = document.getelementbyid('socialuserlist'); console.log($(socialuserlist).html());
from jquery pure javascript:
var socialuserlist = $('#socialuserlist'); console.log(socialuserlist[0].innerhtml);
Comments
Post a Comment