change text of corresponding label when checkbox is checked/unchecked
<p>I can't get this javascript function to work. Any help would be much appreciated!</p>

<hr>

<pre><code>&lt;input type="checkbox" class="checkit" name="smoking" id="smoking" value="1" onclick="yesno('smoking','yesnos');" /&gt;&lt;label for="smoking" name="yesnos" id="yesnos"&gt;No&lt;/label&gt;

        function yesno(thecheckbox, thelabel){
            var checkboxvar = document.getElementById(thecheckbox);
            var labelvar = document.getElementById(thelabel);
            if (checkboxvar.checked == false){
                document.getElementById(labelvar).innerHTML = "No";
            }
            else{
                document.getElementById(labelvar).innerHTML = "Yes";
            }
        }
</code></pre>
