I have this Prototype code at the top of my page
<script type="text/javascript">
if( window.location == 'http://example.com/about-us.html' ) {
$('about-us').addClassName('active');
}
</script>
and this html afer this javascript code
<ul>
<li id="about-us">
<a href="#">
<span>About Us</span>
</a>
</li>
<li id="something-else">
<a href="#">
<span>Something Else</span>
</a>
</li>
</ul>
But even the address is correct http://example.com/about-us.html the class active is not append at all. I have tried alert and alert is working, so the condition is OK, however addclassname seems to not working.
What am I doing wrong? Thanks in advance.