Holen Sie sich CSS-ID von URL

Es ist wahrscheinlich eine dumme Frage, aber gibt es eine Möglichkeit, die CSS-ID aus der URL auszuwählen? Zum Beispiel in einer URL wie dieser:

www.website.com#adiv

bekommen#adiv mit Javascript / jQuery?

Bearbeiten

Mein bisheriges Drehbuch:

$(document).ready(function() {
    var c = window.location.hash;
    $(c).addClass('current');
    $('a').click(function (){
        $('.current').removeClass('current');
        $(this).addClass('current');
    });
});

HTML:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Title</title>
  <link rel="stylesheet" href="style.css">
  <script src="jquery-1.4.2.min.js"></script>
  <script type="text/javascript">
    $(document).ready(function() {
        var c = window.location.hash;
        $(c).addClass('current');
        $('a').click(function () {
            $('.current').removeClass('current');
            $(this).addClass('current');
        });
        $('a[href*=#]').click(function() {
            if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
            && location.hostname == this.hostname) {
                var $target = $(this.hash);
                $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
                if ($target.length) {
                    var targetOffset = $target.offset().top;
                    $('html,body').animate({scrollTop: targetOffset}, 1000);
                    return false;
                }
            }
        });
    });
    </script>
</head>
<body>
    <nav>
        <a href="#header">First</a>
        <a href="#second">Second</a>
    </nav>
    <section id="header">
        ...
    </section>
    <section id="history">
        ...
    </section>
</body>
</html>

Antworten auf die Frage(1)

Ihre Antwort auf die Frage