title: jQuery .attr('id') returns empty
body: <p>Here is my code</p>
  
  <pre><code>    $('.sort').click(function(){
          console.log($(this).attr('id'));
          $.cookie('sortby', $(this).attr('id'), { expires: 25 });
          //window.location.reload(true);
      });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;button id="name" class="sort"&gt;Name&lt;/button&gt; 
  &lt;button id="price" class="sort"&gt;Price&lt;/button&gt; 
  &lt;button id="popular" class="sort"&gt;Popularity&lt;/button&gt;
  </code></pre>
  
  <p>My cookie ends up empty and the console shows up as </p>
  
  <pre><code>popular
  (an empty string)
  </code></pre>
  
  <p>It seems it is getting the correct id but then changing it to null
  Any suggestions?</p>