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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -