I'm styling something using the following code:
$( document ).ready(function(){
$("div.event").closest('td').addClass('success');
This works great on first loading the page, but when I navigate back to the page or am redirected by a controller (this app is on Rails), the class has left the element.
For some context, this app renders events inside of a calendar styled table. The intention is to highlight the table td if there is an event inside of it.
Any insights how I can get it to persist would be appreciated.