how to turn off buttons within a variable?
<p>I have a piece of code below where it contains 26 buttons from A-Z. Each button can be turned on and turned off.</p>

<pre><code>&lt;?php
    $a = range("A","Z");
?&gt;

&lt;?php
        $i = 1;
        foreach($a as $key =&gt; $val){
            if($i%7 == 1) echo"&lt;tr&gt;&lt;td&gt;";
            echo"&lt;input type=\"button\" onclick=\"btnclick(this);\" value=\"$val\" id=\"answer".$val."\" name=\"answer".$val."Name\" class=\"answerBtns answers answerBtnsOff\"&gt;";      
            if($i%7 == 0) echo"&lt;/td&gt;&lt;/tr&gt;";
            $i++;
        }
    ?&gt;
</code></pre>

<p>Below is the code where I am trying to turn on and off the correct buttons but the problem is that it is not turning off the buttons it should be turning off.</p>

<pre><code>var answers = '#answer'+btn;
$('.answers.answerBtnsOn').find('answerBtnsOn').addClass('answerBtnsOff');
</code></pre>

<p>Now if I change the last line of code to code below:</p>

<pre><code>$('.answerBtnsOn').find('answerBtnsOn').addClass('answerBtnsOff');
</code></pre>

<p>then it works but the problem is that all my buttons have the class ".answerBtnsOn", I only want the buttons within the "answers" variable to be turned off when it should be. So how can I turn off buttons within the "answers" variable?</p>
