html - Check if a div does NOT exist with javascript -


checking if div exists simple

if(document.getif(document.getelementbyid('if')){  } 

but how can check if div given id not exist?

var myelem = document.getelementbyid('myelementid'); if (myelem === null) alert('does not exist!'); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -