JavaScript & Current page Active State

Greetings fellow human beings,

I am trying to find some code examples of how to apply an ‘active state’ to an unordered list item to reflect the current page the user is on.

In the past I have accomplished this using only CSS, I would give each <body> tag on each page a unique ID, and reference through that ID to the navigation item and apply the Active State styling that way.

However, for this project I am working on it is unfeasable to accomplish this task in the same way, and so, I am looking at JavaScript to do what I need.

I can’t find any examples on Google because apparently Active State is a company and therefore, populates almost all of the search results.

I should also mention that the header where the <body> tag lies is a Perl include, and so, it is the same across the entire website. (Hence, why I can’t use CSS and give each body tag its own ID).

Please, hook a brother up!!