I'm trying to figure out how to write this, for example. When the user clicks on the button with id "niekket"
it needs to now the user specifically clicked on that button. After the user has clicked on "niekket"
and would like to reset the values by clicking on the button with id "resetbtn"
. id("uitvoer").innerHTML = // output (a string) depends on which button has been clicked (on niekket or pap) by the user before clicking on the resetbtn
it should output this alert("You clicked on button niekket") else alert("You clicked on the button pap before clicking on the resetbutton")
Any help would be appreciated!
function allEvents() {
id("niekket").onclick = function () {
toonGegevens(niekket);
};
id("pap").onclick = function () {
toonGegevens(pap);
};
id("resetbtn").onclick = function () {
id("voornaam").value = "";
id("achternaam").value = "";
id("geboortejaar").value = "";
id("uitvoer").innerHTML = // output (a string) depends on which button has been clicked (on niekket or pap) by the user before clicking on the resetbtn
};
}
allEvents();
Aucun commentaire:
Enregistrer un commentaire