if element in dom function code example
Example: js check if dom element exists
var myElement = document.getElementById("myElementID");
if(!myElement){
//#myElementID element DOES NOT exist
}
if(myElement){
//#myElementID element DOES exists
}