When I input some text in an <input type="text">
, and the text matches some previously input text, the browser will present a dropdown and I can reuse that text.
But which javascript event will the input receive when that text is selected?
- onkeydown/onkeyup does not trigger
- onchange does not trigger.
- In Firefox, it seems like onselect is triggered, but not in chrome. However, that event is used for other purposes.
- onclick does not trigger.
- onblur is as usually only triggered when the input loses focus.