Check is checkbox is clicked?
<p>Say for example I have the following:</p>

<pre><code>&lt;input type="checkbox" id="chk-box1" name="chk-box1" value="Check 1"&gt;Check 1

&lt;input type="text" id="textbox1" name="textbox1" value=""&gt;
</code></pre>

<p>I can set the value of the textbox when "chk-box1" is clicked by doing:</p>

<pre><code>$('#chk-box1').change(function(){
    var chk = $(this);
    $('#textbox1').val("Textbox 1 is checked")('selected', chk.attr('checked'));
})
</code></pre>

<p>but how could I set the value of the textbox to empty when the box is unchecked? <code>$('#textbox1').val("")</code></p>
