One jQuery Change Event on Multiple Elements

前端 未结 6 1355
醉酒成梦
醉酒成梦 2021-01-11 13:46

I have 3 textboxes, all with the same id\'s that I process into ASP by bringing it into a controller array

I have a link that adds an unlimited number of textboxes b

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-11 14:15

    @Eli answers exactly matches for you. If you want to read all the Text-boxes then you can use the following method.

      $('input[type=text]').each(function () {
                        $(this).change(function () {
                            alert($(this).val());
                            $(this).focus();
                        });
                    });
    

提交回复
热议问题