-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMCQ.html
More file actions
43 lines (35 loc) · 1.33 KB
/
MCQ.html
File metadata and controls
43 lines (35 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MCQ - Question</title>
<script>
function mcq(){
var Question1 = document.getElementsByName('Question1');
for (i = 0; i < Question1.length; i++) {
if (Question1[i].checked)
var answer = Question1[i].value;
if(answer == "cwp"){
document.getElementById("answer1").innerHTML
= "Right Answer : cwp "
}else{
document.getElementById("answer1").innerHTML
= "Wrong Answer : ";
}
}
}
</script>
</head>
<body>
<p>1. Which of the following rivers was known as Purushni in the Vedic period ?</p>
1. <input type="radio" value="cwp" name="Question1"> CWP <br>
2. <input type="radio" value="pankaj" name="Question1"> Pankaj <br>
3. <input type="radio" value="joy" name="Question1"> Joy <br>
4. <input type="radio" value="p4n" name="Question1"> p4n <br> <br>
<button onclick="mcq()">Check Answer</button>
<p>
Answer : <span id="answer1"></span>
</p>
</body>
</html>