I'm trying to do some tweeking of a wordpress theme, and hide a certain div
only on certain pages with some javascript, the code I have come up with is:
if(document.getElementsByClassName("page-title") === "NEW ARRIVALS"){
document.getElementById("pull_9").style.visibility="hidden";
}else if(document.getElementsByClassName("page-title") === "SALE"){
document.getElementById("pull_9").style.visibility="hidden";
}else{
document.getElementById("pull_9").style.visibility="visible";
};
but its not working, I know that getElementByClassName() is not supper supported yet but it will do for these requirement.
can anyone see why this is not working? its probably something very simple (I'm new to javascript) but i cant theoretically see why it shouldn't work.