Stack Overflow Questions Tags Users Badges Unanswered Ask Question How can I select a RadioButton when a TextBox is selected

by manoj

HTML

<input type=radio ID="rbOption3" />
Pay other amount
<input type=text ID="txtOtherAmount" /><br />
    <div id="div_text" style="float:right; width:380px;">
        The minimum amount for web payments is $20. If you are looking to pay a lower
        amount, please <a href="#">contact us</a> and speak with a representative.
    </div>

JavaScript

$(function(){
    $("#txtOtherAmount").click(function(){
      $("#rbOption3").prop('checked', true);
    });
    
    $("#div_text").click(function(){
      $("#rbOption3").prop('checked', true);
      $("#txtOtherAmount").focus();  
    });
});