title: Jquery Attribute selector click
body: <p>I'am trying to select a <code>div</code> with a specific attribute. I want the <code>div</code> to be clicked only if there is a specific <code>attribute</code> with a <code>true</code> value.The problem is that if i click the <code>div</code> again the alert still shows up whereas it has the <code>attribute</code> with <code>false</code> value.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;a href="#" data-spinner="true"&gt;Click Here&lt;/a&gt;
  </code></pre>
  
  <p>Jquery</p>
  
  <pre><code>$("a[data-spinner='true']").click(function() {
          $("a[data-spinner='true']").attr("data-spinner",false);
      alert("clicked");
  });
  </code></pre>