Okay, I solved my problem:
I wanted to press up and down to adjust textbox values for numbers, and when setting the value it wouldn't trigger events.
I needed to add "this.oninput()" which triggers the on change events.
using execjs
"$(document.getElementById('number')).on('keydown', function(event) {
if(event.which==38){
this.value=parseInt(this.value)+1;
event.preventDefault();
this.oninput();
}else if(event.which==40){
this.value=parseInt(this.value)-1;
event.preventDefault();
this.oninput();
}
});"