How to add a class to a element depending on the anchor of the page ?

How to add a class to a element depending on the anchor of the page ?

Ohai,

First, my url looks like this : http://site.com/#a1111
I would like, depending on the value of the anchor called, to add a class to the box related.

Actually, i have :


  1. <div id="a1111">text</div>
  2. <div id="a2222">text</div>
  3. <div id="a3333">text</div>

And i would like that when the page is called like in the previous example, the "highlight" class is added to the box with the id "a1111":



  1. <div id="a1111" class="highlight">text</div>
  2. <div id="a2222">text</div>
  3. <div id="a3333">text</div>

Would you have any idea on how to do so ?
(the link is external to the page)

Thanks