Check if the radio button is changed by the keyboard or mouse

后端 未结 6 2029
遇见更好的自我
遇见更好的自我 2021-01-15 08:14

Is possible to tell how a radio button was selected, i.e. if the user used the keyboard or the mouse to click the radio button?

6条回答
  •  既然无缘
    2021-01-15 08:58

    event.detail is another possible indicator if click is caused by keyboard, indicating click number. That gives better cross-browser solution, compared to event.x/y.

     a
     b
     c
    
    
    

提交回复
热议问题