How do you handle a form change in jQuery?

后端 未结 13 2091
生来不讨喜
生来不讨喜 2020-11-28 21:18

In jQuery, is there a simple way to test if ANY of a form\'s elements have changed?

EDIT: I should have added that I only need to check on a c

13条回答
  •  忘掉有多难
    2020-11-28 21:26

    A real time and simple solution:

    $('form').on('keyup change paste', 'input, select, textarea', function(){
        console.log('Form changed!');
    });
    

提交回复
热议问题