The requirements were:
- If the parent checkbox is checked, then all the children checkboxes will be checked.
- If the parent checkbox is unchecked, then all the children checkboxes are unchecked.
- If some of the children checkboxes are checked, then the parent check box will be in the indeterminate state
Here is my example implementation in plain js https://jsfiddle.net/k5x8Lf2q/5/