Watch for change of the input[type=“checkbox”]

前端 未结 5 1969
旧时难觅i
旧时难觅i 2021-02-13 15:17

How can I run a function on checkbox change?

I\'m trying to write small checkbox replacing function base on that - but I\'m doing something wrong.

Code:

5条回答
  •  青春惊慌失措
    2021-02-13 15:58

    In your example the selector uses checbox, should be ".checkbox"

    I modified your example so it works: http://jsfiddle.net/yGBAK/41/

    I swapped the ids for elements.

提交回复
热议问题