Bind JavaScript jQuery click event on label AND on checkbox simultaneously

前端 未结 2 895
夕颜
夕颜 2021-01-11 10:54

I\'m using labels for my form, like this :



2条回答
  •  星月不相逢
    2021-01-11 11:31

    The change event should fire for the input whether the label or input is clicked:

    $("#foo").change(function () { ... });
    

    Example http://jsfiddle.net/andrewwhitaker/6LMXW/

提交回复
热议问题