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