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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -