Click event triggering two times

前端 未结 5 718
终归单人心
终归单人心 2021-01-18 21:25


I am trying to run some function when clicking on the label text but the click event fired two times.
HTML

5条回答
  •  青春惊慌失措
    2021-01-18 22:21

    Move your input outside of your label, and use the for="" attribute.

    
    
    

    JSFiddle: https://jsfiddle.net/hvv6ucu8/2/

提交回复
热议问题