Is there any way I can create a constant function that listens to an input, so when that input value changes, something is triggered immediately?
I am looking for so
As a basic example...
HTML:
Script:
/* event listener */ document.getElementsByName("Thing")[0].addEventListener('change', doThing); /* function */ function doThing(){ alert('Horray! Someone wrote "' + this.value + '"!'); }
Here's a fiddle: http://jsfiddle.net/Niffler/514gg4tk/