Get checkbox values with vanilla JavaScript

preview_player
Показать описание

Tutorial on how to get the values from multiple checkboxes from a HTML form using vanilla JavaScript.
#checkboxes #javascript #form #javascript_tutorial #webdevelopment #frontend #html #htmlforms #frontend #programming

⚡ NEW: Web development courses from Meta Inc. ⚡

Рекомендации по теме
Комментарии
Автор

You just helped me with an assignment where I had to create a site for a pizzeria. The toppings had to be created in a "checkbox" field then I had to print the results on the HTML page. Your video worked!

kelvinguzman
Автор

Excellent short and straight to the point tutorial. Thanks

ashkanahmadi
Автор

Thank you; this is very helpful. Currently working on a small app with checkboxes, where I want to be alerted to which items are not checked off if I try to submit. I think the second method might be a good solution.

TinyMaths
Автор

I've been working on an electron app for some time now (just something to learn with) and I've been trying to figure out how to save checkboxes and effects on a div (IE: visible or none) and storing those within localStorage. Is there a way to use the checkbox clicking event as the "listener" event instead of having to use a button to submit?

IE: If the user checks a box then it would hide a div and then save that choice in localStorage as it is being checked.

The reason I ask this is because I'm creating the HTML using JS literal templates and I can't run functions within the template as it stands now.

TheMorrogoth