0

I need to get the value of an html input after some text has been pasted. Seems obvious to handle the input's onpaste event, but that appears to fire before the text is actually pasted.

For example...

When one pastes some text into that input the alert shows an empty string. Clicking ok then shows the pasted text appearing in the text box.

I've tried using setTimer("someFunction()", 1), then looking at the input inside someFunction(), but that seems like a kludge.

What's the best way to get to the input's text after something's been pasted?

Thanks! Curt

  • This worked for me https://stackoverflow.com/a/10972973/13747074 If this is not your case sent your code? – Yanis02015 Aug 13 '21 at 13:51
  • 1
    Thanks, Yanis. Setting a timer seemed a little kludgey to me, but it seems that's the way to do it. That link did help, though - that link did help, though. A little bit cleaner than what I had in mind.... Thanks, again. – curtisdehaven Aug 17 '21 at 14:17

0 Answers0