I have a textbox with a keydown handler. The handler detects if you press escape and if so it is meant to clear the textbox value. However, calling tb.value = "" normally works, unless the textbox has focus in which case it does nothing. I suspect I have to select the text and delete it, but how? This is in Firefox 12.
I have a textbox with a keydown handler. The handler detects if you press
Share
Have a look at this:-
LIVE DEMO
HTML:
JS: