I have an event handler that I would like to have executed after the default javascript handling of that event occurs.
Is this possible?
EDIT:
For example:
everytime a keypress event is fired, i’m logging event information about that keypress(similar to console.log). Now, when I press backspace and view the fields contents via the event handler, the value of the text field produces the value without the backspace since the event handler grabs the contents of the field before the actual removal of the last letter.
I would like, in this case, for the default backspace event to occur and then have my event handler fired upon completion.
Thanks!
I believe your problem is caused by listening for the keypress event instead of the keyup event. Basically this means that you are getting the value of the textarea before the character is put in the dom.
Try changing your keypress handler to a keyup handler.
An example would be:
Edit: Found this question which appears to be your exact problem.