Select a gender option and one or more script checkboxes. The demo reads the checked values without submitting the page.
const scripts = [...document.querySelectorAll('input[name="scripts"]:checked')];
if (scripts.length === 0) {
result.textContent = "Select at least one script.";
return;
}
result.textContent = scripts.map((box) => box.value).join(", ");
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.