Checking if a div exists is fairly simple
if(document.getif(document.getElementById('if')){ }
But how can I check if a div with the given id does not exist?
var myElem = document.getElementById('myElementId'); if (myElem === null) alert('does not exist!');
1.4m articles
1.4m replys
5 comments
57.0k users