html
html
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
<!-- updated 19/09/2020
Made by Rankush-->
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<center>
<h2>QUIZ <b>📖</b> GAME</h2>
<BR><BR><BR></BR><button id="button"><marquee style="color:red;"><b>Best of luck👍</b></marquee></button></BR></BR>
<button class="button" onclick="quiz()">Start</button>
<audio controls style="display:none"; loop= id="music"
src="https://www.mboxdrive.com/Learn.mp3" id="music" controls="" >
<!-- <button onclick="animation()">
Enter to Rename, Shift+Enter to Preview
css
css
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
body {
background-color: black;
}
h2{
word-spacing:14px;
letter-spacing:2px;
color: red;
}
/* made by Rankush*/
#button{
width:80%;
}
.button{
margin-top:50%;
background-color: red;
border-radius:4px;
border:2px solid white;
color: white;
font-size:25px;
padding:40px 100px
}
.button:hover{
color: white;
Enter to Rename, Shift+Enter to Preview
js
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
// Made by Rankush
var score=0;
function quiz(){
document.body.style.backgroundColor="lightblue";
var name=prompt("Enter your nice name");
alert(name+" Welcome in Quiz Game");
alert("RULE OF THIS QUIZ\n\nEach correct answer=5 Point\nNot correct answer=0 Point\n You must write option only not answer\nSuppose option [a] is correct you must write a in Prompt box ");
//question start here
var select=prompt("What type of question do you want\n\n[a]Science\n[b]Maths");
if(select=="a"){
// Science question 1
var q1=prompt("H20=?\n[a]Helium\n[b]Water");
if(q1=="b"){
alert("Correct");
score+=5;
}
else{
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run