I have a container and inside it a bunch of radio and checkboxes. How can I create an onclick handler for the container so that it gets triggered when a checkbox or radio button inside the container is clicked? For exampel, a click might make the container change its css class. Say, if it doesn't have "css_class1", this class gets added to it.
I want to do that in pure javascript.
Is it possible at all or do I have to create an onclick handler for each checkbox and radio individually?