Detecting interaction with select box

前端 未结 3 2095
庸人自扰
庸人自扰 2020-12-21 11:48

How (using javascript or jQuery) can I detect when a value has been selected from a select box, even if it\'s the same option as was previously selected (i.e. no change even

3条回答
  •  半阙折子戏
    2020-12-21 12:20

    I have no idea if it would work just from the top of my head if you could attach an event handler to the select box option element and on click store its value.

    works with mouse, doesn't work with keyboard http://jsfiddle.net/w4DEJ/4/

提交回复
热议问题