jQuery 'if .change() or .keyup()'

后端 未结 7 689
说谎
说谎 2020-12-13 05:26

Using jQuery i would like to run a function when either .change() or .keyup() are raised.

Something like this.

if ( jQuery(         


        
7条回答
  •  悲哀的现实
    2020-12-13 05:53

    That's not how events work. Instead, you give them a function to be called when they happen.

    $("input").change(function() {
        alert("Something happened!");
    });
    

提交回复
热议问题