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

Popular posts from this blog

Receive udp packets in android gstreamer -

php - Extract Text from HTTP referer -

matplotlib - PYTHON: Annotate boxes disapear dependant on range -