title: Disable linkbutton (anchor tag) with jquery
body: <p>I have trouble with my jquery disabling my linkbutton from clicks after the first click has taken place.</p>
  
  <p>The click should also remove and add some cssStyles.</p>
  
  <p>The problem is no that the linkbutton (anchortag rendered in html) dosent get disabled after the cssStyles has been changed.</p>
  
  <p>After a postback(triggered manually by me) it goes disabled. but that is not something i want. i want it to be a smooth transaction and no postback.</p>
  
  <p>MarkupCode:</p>
  
  <pre><code>&lt;asp:LinkButton ID="LinkButton" runat="server" OnClientClick="" CommandName="Answer" CssClass="linkButton" &gt;
     &lt;asp:Panel ID="PoptionText" runat="server" CssClass="buttonStyle"&gt;
        &lt;%# Eval("optionText") %&gt;
        &lt;div&gt;
           &lt;asp:Label ID="lbRätt" runat="server" Visible="false" CssClass="aktiv"&gt;&lt;/asp:Label&gt;
        &lt;/div&gt;
     &lt;/asp:Panel&gt;
  &lt;/asp:LinkButton&gt;
  </code></pre>
  
  <p>Javascript code:</p>
  
  <pre><code>$(document).ready(function () {
      $("#LinkButton").click(function () {    
          $("#LinkButton").attr("disabled", "disabled"); //this does not happen
          Rightanswer(); // This happens. Function to add remove cssStyles
      })
      $("#LinkButton").click(function (e) {
          if ($("#LinkButton").attr("disabled") == "disabled") {
              e.preventDefault();
          }
      });    
  });
  </code></pre>