Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (7k points)
I have been trying to experiment in JavaScript and I want to know how can I get an alert on my window saying that the checkbox has been checked. I want it in plain JavaScript.

1 Answer

0 votes
by (13.1k points)
edited by

Here is an example using plain javascript of how can you check:
Body:

<label>

<input id="checkboxcheck" type="checkbox" >checkbox

</label>

<button onclick="Function()">

Check value

</button>

Script:

function Function() {

  var variable = document.getElementById("checkboxcheck").checked;

  alert(variable);

}

Are you willing to pursue a career in Web Development, here's an opportunity for you Web Development Courses Online training provided by intellipaat!

Related questions

0 votes
0 answers
0 votes
1 answer
+2 votes
2 answers

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...