<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
var risposto=false;
function rispondi(messaggio) {
if (risposto) return;
risposto=true;
document.getElementById("risposta").innerHTML=messaggio;
}
</script>
</head>
<body>
<h1>Qual è il colore del cavallo bianco di Napoleone?</h1>
<h3 id="risposta" > </h3>
<p>
<button onclick="rispondi('risposta errata');">Nero</button>
<button onclick="rispondi('risposta corretta');">Bianco</button>
<button onclick="rispondi('risposta errata');">Pezzato</button>
</p>
</body>
</html>
Comments