One jQuery Change Event on Multiple Elements

前端 未结 6 1396
醉酒成梦
醉酒成梦 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:00

    Since id is unique, you should using class instead. Then you can iterate over your class using each and apply $(this) to target current change input:

    $('input.invent').each(function () {
        $(this).change(function () {
    
        });
    });
    

提交回复
热议问题