JS проверить, скрыт ли элемент
if (elem.getAttribute("hidden") != null){
//code if elem is hidden
}
Teacrumble
if (elem.getAttribute("hidden") != null){
//code if elem is hidden
}