I'm doing a questionnaire/survey using HTML. I need to get the value of the checkbox that is being checked. The questions on the next page(L2) will be based on the questions that is only checked on the checkbox when i click "submit".
I have a problem in getting and storing the value of the checkbox and using it later for an IF else-If else statement. Read a lot of online materials but I can't see any light from this. Any help will do... here is the code of the plain checkbox.
<html>
<head>
</head>
<body>
<script>
var vg = document.getElementId("VideoGame").checked;
var te = document.getElementId("Text").checked;
var an = document.getElementId("Animals").checked;
var sp = document.getElementId("Sports").checked;
var lo = document.getElementId("Logo").checked;
</script>
<form action="L2.html">
Check the box if applicable: <br>
<input type="checkbox" name="Q1" id="VideoGame"> The image is a Video Game.
<br>
<input type="checkbox" name="Q1" id="Text"> The image contains text. <br>
<input type="checkbox" name="Q1" id="Animals"> The image is about animals.
<br>
<input type="checkbox" name="Q1" id="Sports"> The image is about sports.
<br>
<input type="checkbox" name="Q1" id="Logo"> The image contains a logo. <br>
<input type="submit" value="NEXT">
</form>
</body>
</html>