Show / Hide code
<html>
<head>
<title>Quiz</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
}
h1 {
width: 100%;
font-size: 3em;
background-color: #fec055;
margin: 0;
text-align: center;
padding: 0.25em 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
form {
margin: 1em;
font-size: 1.5em;
}
input,
label {
cursor: pointer;
}
input[type="text"] {
font-size: 1.2em;
cursor: text;
}
.submit {
height: 2.5em;
width: 8em;
font-size: 2em;
background-color: #fec055;
border: 0;
margin-top: 0.5em;
text-align: center;
position: absolute;
left: 50%;
margin-left: -4em;
line-height: 2.5em;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media (max-width: 400px) {
.submit {
width: 100%;
margin-left: 0;
left: 0;
}
input[type="text"] {
width: 100%;
}
}
</style>
</head>
<body>
<h1>Quiz</h1>
<form action="quiz.php">
<input type="text" name="name" placeholder="Dein Name" required>
<div>
<p>Was ist 1 + 1?</p>
<input type="radio" id="r1" name="plus" value="2" required><label for="r1">2</label>
<input type="radio" id="r2" name="plus" value="sqrt5"><label for="r2">√5</label>
<input type="radio" id="r3" name="plus" value="nr"><label for="r3">Nicht rechenbar</label>
</div>
<div>
<p>Für was steht CSS?</p>
<input type="radio" id="r4" name="css" value="style" required><label for="r4">Cascading Style Sheets</label>
<input type="radio" id="r5" name="css" value="super"><label for="r5">Context Super Sytle</label>
<input type="radio" id="r6" name="css" value="something"><label for="r6">Christopher Says Something</label>
</div>
<div class="submit">Auswerten !!!</div>
</form>
<script>
var submit = document.querySelector(".submit");
var form = document.querySelector("form");
submit.addEventListener("click", function(){
form.submit()
});
</script>
</body>
</html>