Skip to content
Advertisement

Check | Uncheck – Checkbox Array By Id

Using only JavaScript, and regarding my code, how can i check and uncheck with a checkbox as trigger the whole checkbox array?

JavaScript

Advertisement

Answer

You can’t give multiple elements the same ID. Give all elements the same Class and select them with getElementsByClassName like shown in my snippet.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement