Hi all,
I have read in the article (the article) following concepts about event handlers:
For a non-bubbling event, the sequence of the dispatch is like this:
- Capturing phase: All "capturing" event handlers are fired on all ancestor elements, from the top down.
- The event is fired on the target element, which means that all event handlers registered on the element for the specific event are executed (in undefined order!)
- The default action is performed (if it wasn't cancelled in any of the handlers)
For a bubbling event, the sequence is like this:
- Capturing phase: All "capturing" event handlers are fired on all ancestor elements, from the top down.
- The event is fired on the target element
- Bubbling phase: The event is fired on all ancestor elements, from the target and upward.
- The default action is performed (if it wasn't cancelled in any of the handlers)
Here, default action is essentially a browser activity which user expects when produced an event, i.e. character appearance in textarea when key was pressed.
Does any body now how attach callback that will be called after default action is performed? So I would like to catch an event when character appeared in textarea.
onchange is not a solution because it is fired when focus lost. onkeyup is not the solution also
Any ideas?
[UPD] I am trying to catch a textarea value change right after the change was happened. This is for copying value of textarea to a div. So when I use onkeydown event, the div content is updated with a delay of one key press. I want to have right after keypressed.