title: Remove selected class jquery
body: <p>I've got the following HTML:</p>
  
  <pre><code>&lt;a href="#"&gt;img/a.jpg&lt;/a&gt;
  &lt;a href="#"&gt;img/b.jpg&lt;/a&gt;
  &lt;a href="#"&gt;img/c.jpg&lt;/a&gt;
  </code></pre>
  
  <p>For selected links I've got the following:</p>
  
  <pre><code>$(function() {
              $("a").click( function( )
              {
              var current = $(this);
              var name = current.attr('href');
              current.addClass("selected");
              var prev = current.closest("a").find("a.selected");
              prev.removeClass("selected");
                  return false;
              });
          });
  </code></pre>
  
  <p>The problem is that after I click some link the previous one I clicked won't deselect(remove class selected). Any help will be greatly appreciated.</p>