I have this right now:
This does infact work, except, it r
This is because the onpaste
event fires before the content gets pasted into the element (link) so it's not there yet at the time you handle it.
Modern browsers support methods of obtaining clipboard data inside the event handler. Refer to JavaScript get clipboard data on paste event (Cross browser) for cross-browser solution attempts.
Also, you can always work around your issue by simply starting a timer in the event handler function (10ms should be enough) that would check your input value later.