javascript - jQuery - bind multiple events and exclude other events -


i've got search form has both <input type="text"> , <select> form elements. listening in form i've got jquery...

$('#searchform :input').stop().on('keyup change',function(){     // ajax stuff }) 

the tricksy bit way script listens multiple events using .on('keyup change' etc.). works great there's problem...

when input fields lose focus script jquery listener triggered.

here's demonstration explain mean https://jsfiddle.net/o2k4jf90/1/

i want this...

$('#searchform :input').stop().on('keyup change not:blur',function(){     // ajax stuff }) 

...but that's nonsense. can do?

try substituting input event change , keyup events

$(document).ready(function () {     $(':input').on('input',function(e) {         $('#report').append('stuff happened<br />');     }) }); 

jsfiddle https://jsfiddle.net/o2k4jf90/3/


Comments