Superhero Quiz
About this app
Test your knowledge about superheroes with this fun quiz app.
Superhero Quiz Superhero Quiz What is the alter ego of Batman? a) Bruce Wayne b) Clark Kent c) Peter Parker Which superhero is known as the "Man of Steel"? a) Spider-Man b) Iron Man c) Superman Who is the strongest Avenger? a) Hulk b) Thor c) Captain America Submit
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Superhero Quiz</title>
<meta name="description" content="Test your knowledge about superheroes with this fun quiz app.">
<meta name="keywords" content="superhero quiz, superhero trivia, superhero knowledge, quiz app">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<style>
body {
background-color: #f1f1f1;
font-family: 'Roboto', sans-serif;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
margin-bottom: 30px;
}
.question {
margin-bottom: 20px;
}
.options label {
display: block;
margin-bottom: 10px;
}
.btn {
display: block;
margin-top: 20px;
width: 100%;
padding: 10px;
text-align: center;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s;
}
.btn:hover {
background-color: #0056b3;
}
.result {
text-align: center;
margin-top: 20px;
font-size: 18px;
font-weight: bold;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Superhero Quiz</h1>
<div class="question">
<p>What is the alter ego of Batman?</p>
<div class="options">
<label>
<input type="radio" name="question1" value="a"> a) Bruce Wayne
</label>
<label>
<input type="radio" name="question1" value="b"> b) Clark Kent
</label>
<label>
<input type="radio" name="question1" value="c"> c) Peter Parker
</label>
</div>
</div>
<div class="question">
<p>Which superhero is known as the "Man of Steel"?</p>
<div class="options">
<label>
<input type="radio" name="question2" value="a"> a) Spider-Man
</label>
<label>
<input type="radio" name="question2" value="b"> b) Iron Man
</label>
<label>
<input type="radio" name="question2" value="c"> c) Superman
</label>
</div>
</div>
<div class="question">
<p>Who is the strongest Avenger?</p>
<div class="options">
<label>
<input type="radio" name="question3" value="a"> a) Hulk
</label>
<label>
<input type="radio" name="question3" value="b"> b) Thor
</label>
<label>
<input type="radio" name="question3" value="c"> c) Captain America
</label>
</div>
</div>
<button class="btn" onclick="submitQuiz()">Submit</button>
<div class="result" id="result"></div>
</div>
<script type="text/javascript">
function submitQuiz() {
var answers = {
question1: $('input[name="question1"]:checked').val(),
question2: $('input[name="question2"]:checked').val(),
question3: $('input[name="question3"]:checked').val()
};
var correctAnswers = {
question1: 'a',
question2: 'c',
question3: 'a'
};
var score = 0;
if (answers.question1 === correctAnswers.question1) {
score++;
}
if (answers.question2 === correctAnswers.question2) {
score++;
}
if (answers.question3 === correctAnswers.question3) {
score++;
}
var result = document.getElementById('result');
result.innerHTML = 'You scored ' + score + ' out of 3.';
}
</script>
</body>
</html>
NEW APPS
These are apps made by the community!