Click on a div to toggle a checkbox inside of it using javascript

前端 未结 6 888
耶瑟儿~
耶瑟儿~ 2020-12-15 18:50

This seems to be a simple problem, but I dont use alot of javascript.

I have a div, with a checkbox in it, and would like the whole div to toggle the checkbox. This

6条回答
  •  失恋的感觉
    2020-12-15 19:22

    look into using jQuery rather than programming against the dom yourself. using a library like jQuery means your code is more likely to work on most browsers

    http://docs.jquery.com/Effects/toggle

提交回复
热议问题