How to use jQuery to dynamically change navigation

I would like to change the look of a navigation button that lets the user know they are on that page. I am wondering if there is a way to dynamically change the button to have an .active class instead of hard coding .active on each page.

Any suggestions?

Here’s an effective way from CSS-Tricks:
ID Your Body For Greater CSS Control and Specificity