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
Actually, the ticked answer is exactly right, but the answer can be in ES6 shape:
ES6
HTMLInputElementObject.oninput = () => { console.log('run'); // Do something }
Or can be written like below:
HTMLInputElementObject.addEventListener('input', (evt) => { console.log('run'); // Do something });