Add event to top of event stack using jquery

I use jquery to add a blur event to the text box. I would like my event to fire before any other existing events. Can this be done?

+3
source share
2 answers

Not trivial.

Events are executed in the order in which they are connected. You can unleash all events, bind your object, and then reinstall all events.

0
source

Do something like this:

var fn = document.GetElementByID('x').clicked;
document.GetElementByID('x').clicked = function(){ 
  //action
  fn();
}

In Javascript, functions are pointers to functions.

0
source

Source: https://habr.com/ru/post/1747564/


All Articles