I am trying to find a specific div with class using pure javascript but its not giving me result, so I need advise of experts. Here is my html
<div class="search">
<center><h1>Search Content</h1></center>
</div>
This is the javascript code I am trying;
if(document.div.className.match('search')){
console.log("Found");
} else {
console.log("Not Found");
}
I tried using .classList but it's not supported on IE.10 , so is there any way I can find my required output using pure js?
Here is demo -> https://jsfiddle.net/05aj58nj/