Estou tentando fazer um botão que abre uma janela pop-up quando é clicado. Está funcionando, mas eu gostaria de adicionar uma janela pop-up com três caixas de seleção. É uma tarefa para a escola, então não posso usar nenhuma outra linguagem além de HTML5, CSS e JavaScript. Isso é possível? Este é o código HTML:
<script language="JavaScript" src="prijsvraag.js"></script>
<input type="button" onclick="prijsvraagknop()" value="Prijsvraag"></button>
Este é o código js
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.");
}
Aqui está um exemplo. O html
código consiste nas caixas de seleção mostradas abaixo.
<input type="button" id="popupbutton" onclick="popup(this)"/>
<ul id="checkBundle">
<li><label><input type="checkbox" />test1</label>
<li><label><input type="checkbox" />test2</label>
<li><label><input type="checkbox" />test3</label>
<li><label><input type="checkbox" />test4</label>
</ul>
O javascript está abaixo
function popup() {
var popwindow = document.getElementById("checkBundle");
if (popwindow.style.display === "none") {
popwindow.style.display = "block";
} else {
popwindow.style.display = "none";
}
};
Este artigo é coletado da Internet.
Se houver alguma infração, entre em [email protected] Delete.
deixe-me dizer algumas palavras