enabled and disabled text input on checkbox checked and unchecked
<p>i've checkbox and text input</p>

<p>What I need is to enable text input when i check the checkbox and to disable text input when i uncheck the checkbox</p>

<p>I'm using the following code but it do the reverse enable when unchecked / disable when checked so how to adjust it fit with my needs.</p>

<pre><code>&lt;input type="checkbox" id="yourBox"&gt;
&lt;input type="text" id="yourText"&gt;
&lt;script&gt;
document.getElementById('yourBox').onchange = function() {
document.getElementById('yourText').enabled = this.checked;
};
&lt;/script&gt;
</code></pre>

<p>any help ~ thanks</p>
