How to disable and undisable yes and no buttons
<p>I have 2 buttons which are "Yes" and "No"</p>

<pre><code>&lt;input class="answerBtns answers answerBtnsOff" name="answerYesName"   id="answerYes"   type="button"   value="Yes"     onclick="btnclick(this);"/&gt;
&lt;input class="answerBtns answers answerBtnsOff" name="answerNoName"    id="answerNo"        type="button"   value="No"      onclick="btnclick(this);"/&gt;    
</code></pre>

<p>What I was attempting to do was that if the "Yes" button is highlighted, then disable the "No" button, if the "No" button is highlighted then disable the "Yes" button, and if none of the 2 buttons are highlighted, then remove the disabled from both buttons.</p>

<p>But I can quite seem to get this work, I keep getting errors in my if statement when trying to read the class using .class(), how can I get the function below to work as how I stated I wanted to work?</p>

<pre><code>function btnclick(btn) {
    var context = $(btn).parents('#optionAndAnswer');
    if (context.length == 0) {
        context = $(btn).parents('tr');
    }
    $(btn).toggleClass("answerBtnsOff");
    $(btn).toggleClass("answerBtnsOn");
    if (btn = 'Yes').class('.answerBtnsOn') {
        $(btn = 'No').attr("disabled", "disabled");
    } else if (btn = 'No').class('.answerBtnsOn') {
        $(btn = 'Yes').attr("disabled", "disabled");
    } else if (btn = 'Yes' &amp;&amp; btn = 'No').class('.answerBtnsOff') {
        $(btn = 'Yes' &amp;&amp; btn = 'No').removeAttr("disabled");
    }
    return false;
}
</code></pre>
