How to write this as a function
<p>I'm sort of new to jquery and I have a toggle type jquery piece written below. Just wondering what would be a better way to write this so it's reusable.  </p>

<p>It works like this.
Basically click on one of the radio amount options (they have the class 'nOther') then the other Amount text box is disabled. But click on the other amount radio and the textbox is enabled.</p>

<pre><code>$("input[type='radio'][name='giftType'][value='Other']").click(function(){
        $("input[type='text'][name='otherAmount']").removeAttr('disabled');
});
$("input[type='radio'][name='giftType'][class='nOther']").click(function(){
        $("input[type='text'][name='otherAmount']").attr('disabled', 'disabled');
});
</code></pre>

<p>Clearly there is a better way to write this so i can reuse it</p>

<p>Something like function('value', 'class'){
...
}</p>

<p>Any help is greatly appreciated.</p>
