Using vanilla javascript or prototype can someone show me how I could run a check to see if a class exists? For example I am adding a class called hideIt with this code :
var overlay = document.getElementById("overlay_modal");
overlay.className += " hideIt";
I also need a script that later can check to see if hideIt exists. I have tried things like :
if (overlay.className == "hideIt")
But that is no good. Any ideas?