javascript – How to force '.on("input")' method via script?


I suppose my method:

$(document).on("input", "#textbox", function(){

What script can I force the alert("hi") call?

I tried several and nothing:


Expected behavior:

When typing a character in the quantity field, a function must be called that will calculate the value and quantity fields to play in the total field. When starting the page this function has to be called too. The real case is this: one field with value, another with quantity and another with an empty total. When opening the page, the quantity field will be by default value 1, the value field will vary and the total will be calculated on top of these two values.


You came close in the fiddle:


Scroll to Top