mardi 24 octobre 2017

How can i make a pop-up window with checkboxes using javascript?

I am trying to make a button that opens a pop-up window when it is clicked. It is working, but I would like to add a pop-up window that has three checkboxes. It is an assignment for school, so I can't use any other languages than HTML5, CSS and JavaScript. Is this possible? This is the HTML code:

<script language="JavaScript" src="prijsvraag.js"></script>
<input type="button" onclick="prijsvraagknop()" value="Prijsvraag"></button>

This is the js code

function prijsvraagknop(){
var naam = window.prompt("Jouw naam:")
var jouw_antwoord = window.prompt("Jouw reactie:")

if (document.getElementById('B').checked) {
    alert("Hoera " + NaamVar + "! Je hebt het antwoord goed. Er doen nog meer kinderen mee. Je kunt daarom over een maand op deze pagina lezen of je de hoofdprijs gewonnen hebt.");
    }
else {
    alert("Helaas " + NaamVar + ". Je hebt het antwoord fout. Je maakt geen kans op de hoofdprijs.");
    }   




Aucun commentaire:

Enregistrer un commentaire