For example this can be useful when updating quantities in a shopping cart and you don’t want the values to be updated instantly. Having a delay can give the user enough chance to enter new values or quantities in the text box before the desired action is triggered.
The above jQuery function initiates a new timer element after the page has loaded and a delay variable is defined for 0.6 seconds. Whenever a new value is entered into an input box with the class inputfield, the timer element is reset and triggered after the delay value. In the example above, it is set to submit a form with ID form1.