Check/Uncheck radio on filling textbox <p>I've got this little piece of code here I've been working on for a while, and for some reason it doesn't work. Can somebody have a look at it and tell me whats wrong with it?</p> <p>All I need it to do is to check the "Other amount" radio box when someone enters an amount in the textbox. I'd also like to clear the amount written when any other radios are checked. Cross browser is a must.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Donation amount&lt;/title&gt; &lt;script src="https://code.jquery.com/jquery-1.12.4.min.js"&gt;&lt;/script&gt; &lt;script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $("#donationAmountMan").on("input propertychange change paste keyup", function() { if ($("#donationAmountMan").val().length &gt; 0) { $("#da_man").prop("checked", true); } else { $("#da_man").prop("checked", false); } }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;label&gt;Donation amount&lt;/label&gt; &lt;div&gt; &lt;label&gt;&lt;input type='radio' name='donationAmount' id='da25' value='25' required /&gt; $25&lt;/label&gt; &lt;label&gt;&lt;input type='radio' name='donationAmount' id='da50' value='50' required /&gt; $50&lt;/label&gt; &lt;label&gt;&lt;input type='radio' name='donationAmount' id='da100' value='100' required /&gt; $100&lt;/label&gt; &lt;label&gt;&lt;input type='radio' name='donationAmount' id='da150' value='150' required /&gt; $150&lt;/label&gt; &lt;label&gt;&lt;input type='radio' name='donationAmount' id='da_man' value='0' required /&gt; Other amount &lt;input type='text' name='donationAmountMan' id='donationAmountMan'&gt;$&lt;/label&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Thank you all for your precious help!</p>