forked from saadatalishah/quiz-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
78 lines (72 loc) · 1.59 KB
/
app.js
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
var index=1;
var array;
var x=document.getElementsByTagName("div");
function myfunction(ind)
{
if(index===7)
{
window.location.href='result.html';
}
for(var i=0;i<x.length;i++)
{
x[i].style.display = 'none';
x[index-1].style.display = 'block';
}
array=x.length;
var btn=document.getElementById('save');
index++;
// if(index === 6)
// {
// btn.style.display='block';
// // window.location.href='result.html';
// }
// else{
// btn.style.display='none'
// }
}
myfunction();
var marks=0;
function naya()
{
var radios = document.getElementsByTagName('input');
var value;
for (var i = 0; i < radios.length; i++) {
if (radios[i].type === 'radio' && radios[i].checked) {
// get value, set checked flag or do whatever you need to
value = radios[i].value;
}
}
if(value==='QUAID-E-AZAM'){
marks = marks+10;
localStorage.setItem("marks",marks);
}
if(value==='ISLAMABAD'){
marks = marks+10;
localStorage.setItem("marks",marks);
}
if(value==='7'){
marks = marks+10;
localStorage.setItem("marks",marks);
}
if(value==='1971'){
marks = marks+10;
localStorage.setItem("marks",marks);
}
if(value==='Hafiz'){
marks = marks+10;
localStorage.setItem("marks",marks);
}
if(value==='by using var')
{
marks=marks+10;
localStorage.setItem('marks',marks);
}
// if(value===''){
// marks = marks+10;
// }
// if(value===''){
// marks = marks+10;
// }
// console.log(value);
// console.log(marks);
}