make a filter checkbox with Javascript [closed]

I was given an array like this:

[{"category":"course","id":265,"name":"Compliance","parent_id":"","children":[{"category":"course","id":348,"name":"Code of Ethic","parent_id":265,"parent_id__DESC__":"Compliance"},{"category":"course","id":270,"name":"CS","parent_id":265,"parent_id__DESC__":"Compliance"},{"category":"course","id":271,"name":"Culture","parent_id":265,"parent_id__DESC__":"Compliance"},{"category":"course","id":272,"name":"ICT","parent_id":265,"parent_id__DESC__":"Compliance"},{"category":"course","id":303,"name":"Internal Audit & Compliance","parent_id":265,"parent_id__DESC__":"Compliance"}]},{"category":"course","id":263,"name":"Job Knowledge","parent_id":"","children":[{"category":"course","id":268,"name":"Card","parent_id":263,"parent_id__DESC__":"Job Knowledge"},{"category":"course","id":267,"name":"Deposit","parent_id":263,"parent_id__DESC__":"Job Knowledge"},{"category":"course","id":269,"name":"Digital","parent_id":263,"parent_id__DESC__":"Job Knowledge"},{"category":"course","id":266,"name":"Loan","parent_id":263,"parent_id__DESC__":"Job Knowledge"}]},{"category":"course","id":264,"name":"Skills","parent_id":"","children":[{"category":"course","id":346,"name":"Korean ","parent_id":264,"parent_id__DESC__":"Skills"},{"category":"course","id":309,"name":"Seed The Future 3 (2020)","parent_id":264,"parent_id__DESC__":"Skills"},{"category":"course","id":310,"name":"Soft Skills","parent_id":264,"parent_id__DESC__":"Skills"}]}]

Now I want to make a filter checkbox which shown in the picture below:

checkbox

how can I do that? I have made a version of it but it seem to be not true. https://codesandbox.io/s/clever-mcclintock-jmdmz?file=/app/js/index.js&fbclid=IwAR3EqmIfxsxAKvd_CcLRqw3tRAV7K61y7oJPsKfrTFKkupMcc1KUEMkWAQw



Read more here: https://stackoverflow.com/questions/68463153/make-a-filter-checkbox-with-javascript

Content Attribution

This content was originally published by Nguyễn Trường Minh at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: