How do I implement onchange of <input type=“text”> with jQuery?

后端 未结 14 1156
[愿得一人]
[愿得一人] 2020-11-27 10:15

?

14条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-27 11:11

    You can do this in different ways, keyup is one of them. But i am giving example below with on change.

    $('input[name="vat_id"]').on('change', function() {
        if($(this).val().length == 0) {
            alert('Input field is empty');
        }
    });
    

    NB: input[name="vat_id"] replace with your input ID or name.

提交回复
热议问题