I have a list. In that I have some checkboxes. I am trying to get checkboxes checked in two different ways. One is default way, and another one is when I click on ‘li’. The link to the code is here
When I click on li, the checkbox checks properly, but when i click on checkbox itself, it does not. What could be the issue?
You can solve this by checking the target of the click event. If it’s not an
lielement, don’t run your code.See this updated fiddle for an example.