Using JavaScript to change CSS visibility is trivial
element.style.visibility = 'visible'
element.style.display = 'block'
but, is it possible to go the other way, that is, trigger JS when CSS visibility changes? For example
#element {
visibility: hidden;
display: none;
}
#element::target {
visibility: visible;
display: block;
}
When a user clicks on element
, I want aFunction()
to fire with access to info about the element's DOM properties. I am assuming that is not possible but asking just in case…