jQuery Change Input text upon selection of radio button

前端 未结 5 503
借酒劲吻你
借酒劲吻你 2021-01-28 04:26

Trying to get the value=\"\" of to change upon selection of a radio button. So if the user

5条回答
  •  余生分开走
    2021-01-28 04:54

    it will bind an event handler change of all inputs inside the form searchSelect, with name option1 and of type radio.

    $(function() {
        $('#searchSelect input[name="option1"]:radio').change(function() { 
            $('.box').val('Enter a ' + this.value); 
        });
    });
    

    to learn more about the change event check out the jQuery documentation.

提交回复
热议问题