There is a React function that returns a list of card elements.
When we click one of the elements, the class attribute value becomes card expanded
.
What can we do in JavaScript or jQuery to detect a change in one of these class attributes? When a change is detected on click, I want to check if the element is within viewport, and if so, scroll the element into view.
Any idea how to do the first part?