I want to be able to grab an id (#term) from the end of a url (http://website/page/#term) with Javascript. Not sure how to do that.

I then want to use it in coordination with the following bit of code and run it just after the page has loaded.

Code:
<script>
$('#filters a').find('.active').removeClass('active');
$('#filters a').find('#term').addClass('active');
</script>