Try yourself:
https://www.w3schools.com/code/tryit.asp?filename=FY3C64FZV7UL
A proof that it works on a input tag:
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onselect
Am I doing something incorrectly?
Try yourself:
https://www.w3schools.com/code/tryit.asp?filename=FY3C64FZV7UL
A proof that it works on a input tag:
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onselect
Am I doing something incorrectly?
Apparently in HTML5 the select event only works with input and textarea elements.
see: https://www.w3.org/TR/DOM-Level-3-Events/#event-type-select
World Wide Web Consortium says
The
select
event might not be available for all elements in all languages. For example, in HTML5,select
events can be dispatched only on form input and textarea elements. Implementations can dispatchselect
events in any context deemed appropriate, including text selections outside of form controls, or image or markup selections such as in SVG.