1
Ich habe auf https://www.youtube.com/watch?v=-aaifC_i8jQ
das gefunden.
<!doctype html>
<html lang="de">
<head>
<meta charset=utf-8>
<style>
#msg {
display: none;
}
</style>
<body>
<form>
<input type="checkbox" id="checkbx" onclick="checkMe()"> Bitte checken
<p id="msg">Sie haben die AGB akzeptiert</p>
</form>
<script>
function checkMe(){
var cb = document.getElementById("checkbx");
var meldung = document.getElementById("msg");
if(cb.checked == true){
meldung.style.display = "block";
} else {
meldung.style.display = "none";
}
}
</script>
</body>
</html>
Ich wollte den button austauschen.
<input type="button" id="checkbx" value="pruefen" onclick="checkMe()">
Das funktioniert nicht.Ich weiß nicht warum?
das gefunden.
<!doctype html>
<html lang="de">
<head>
<meta charset=utf-8>
<style>
#msg {
display: none;
}
</style>
<body>
<form>
<input type="checkbox" id="checkbx" onclick="checkMe()"> Bitte checken
<p id="msg">Sie haben die AGB akzeptiert</p>
</form>
<script>
function checkMe(){
var cb = document.getElementById("checkbx");
var meldung = document.getElementById("msg");
if(cb.checked == true){
meldung.style.display = "block";
} else {
meldung.style.display = "none";
}
}
</script>
</body>
</html>
Ich wollte den button austauschen.
<input type="button" id="checkbx" value="pruefen" onclick="checkMe()">
Das funktioniert nicht.Ich weiß nicht warum?