title: coffeescript focus is not setting on my field
body: <p>I want to make client side validation in my project.
  Here the requirement is, if the user submitted blank form or he did not field any one input field, then normal html list should have to generate.
  Under that list, the all input fields should have to come who has error.
  Not only the input field, but it should be the link of that input field.
  Once the links came in that list, then user should be able to click on that link. after clicking on that link, then his focus should have to set on the text field.
  Here I could create link properly, but I can’t set the focus.
  So here my coffeescript:</p>
  
  <pre><code>$(document).ready -&gt;
  # first fetch all input field who have  errors.
    errorElements = $('.content').find('.help-inline').prev()
    ul = $('&lt;ul id="errorlist"&gt;&lt;/ul&gt;')
    errorElements.each (i) -&gt;
      span = $(this).next()
      labelText = $(this).parent().parent().find('label')
      $(' &lt;li&gt; &lt;a href="#' + $(this).attr('id') + '" class="errorlink" &gt;' + labelText.text() + ' ' + '(' + span.text() + ')' + '&lt;/a&gt;&lt;/li&gt;').appendTo(ul)
    $('#errorcontainer').html(ul)
  $(".errorlink").bind "click", (e) -&gt;
    # first I am checking it is binding or not.
    alert('hello')
    $(this).attr(‘href’).setFocus()
  </code></pre>
  
  <p>I am using simple_form for my html.
      So it is generating html for me like this:</p>
  
  <pre><code>  &lt;div class=' content '&gt;
  
  
  &lt;form accept-charset="
  </code></pre>
  
  <p>UTF-8
  " action="
  /levels/basic-computer/topics" class="
  simple_form form-horizontal
  " enctype="
  multipart/form-data
  " id="
   new_topic " method=" post " novalidate=" novalidate "></p>
  
  <pre><code>  &lt;div style=" margin:0;padding:0;display:inline "&gt;
  
  &lt;div class=' form-inputs'&gt;
    &lt;div class=" control-group string required topic_title error "&gt;
    &lt;label class=" string required control-label " for=" topic_title "&gt;
    &lt;abbr title=" required "&gt;
    *
    &lt;/abbr&gt;
    Title
    &lt;/label&gt;
    &lt;div class=" controls "&gt;
    &lt;input class=" string required " id=" topic_title " name=" topic[title] " size=" 50 " type=" text " value="" /&gt;
    &lt;span class=" help-inline "&gt;
    can't be blank
    &lt;/span&gt;
    &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>What I am wrong here?</p>