Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript: Check if page contains a particular div

How do I check using javascript if the page I'm on contains a particular div... e.g turtles

like image 523
Skizit Avatar asked Feb 01 '11 09:02

Skizit


1 Answers

if(document.getElementById("divid")!=null){
  alert('Div exists')
}
like image 164
niksvp Avatar answered Sep 20 '22 03:09

niksvp