Simple CoffeeScript navigation menu I'm using simple script to handle tab menu like this:

HTML:

&lt;nav id="personal"&gt;
    &lt;ul class="clearfix"&gt;
        &lt;li id="personal-info"&gt;Info&lt;/li&gt;
        &lt;li id="personal-orders"&gt;Orders&lt;/li&gt;
        &lt;li id="personal-models"&gt;Models&lt;/li&gt;
        &lt;li id="personal-balance"&gt;Balance&lt;/li&gt;
    &lt;/ul&gt;
&lt;/nav&gt;

&lt;div id="personal-content"&gt;&lt;/div&gt;


and CoffeeScript:

jQuery ($) -&gt;
 class Nav
  constructor: (@elements) -&gt;
    self = @
    wHash = document.location.hash.replace("#", "") or "info"

    # activate element by location hash
    @.activate document.getElementById "personal-#{wHash}"

    # bind element activation on click
    elements.click -&gt;
      self.activate @

  activate: (elem) -&gt;
    @elements.removeClass "active"
    $(elem).addClass "active"

    # set a proper hash
    wHash = elem.id.split("-")[1]
    document.location.hash = "##{wHash}"

    # load proper content into an inner section
    # it works very fast and is the reason i use this type of navigation in the first place

    $("#personal-content").load "/user/#{wHash}"

 new Nav $("#personal").find("li")


This code works, but i'm pretty sure that it's very far away from best practices, and can be greatly improved, as these are my first tries in CoffeeScript. So the question is, can this code be beautified in some way?
You're building a navigation, however there are no links. It's highly recommended to use anchor tags for linking purposes.

Your naming is a bit loose. What is personal in your context? Please specify that. Even something like personal-navigation is quite loose, but still better.

I've changed your markup a bit to reflect my small suggestions. Note that I changed the ID's from your list items to classes. ID's are only for elements which will occur only once a page in any situation. You can't say that for sure for single navigation items.

    &lt;nav id="personal-navigation"&gt;
        &lt;ul class="clearfix"&gt;
            &lt;li class="personal-info"&gt;&lt;a href="#"&gt;Info&lt;/a&gt;&lt;/li&gt;
            &lt;li class="personal-orders"&gt;&lt;a href="#"&gt;Orders&lt;/a&gt;&lt;/li&gt;
            &lt;li class="personal-models"&gt;&lt;a href="#"&gt;Models&lt;/a&gt;&lt;/li&gt;
            &lt;li class="personal-balance"&gt;&lt;a href="#"&gt;Balance&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/nav&gt;

    &lt;div id="personal-content"&gt;&lt;/div&gt;