Editing JavaScript 1 Event Handling
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 365: | Line 365: | ||
<pre> | <pre> | ||
let | let zahl = prompt("Gib eine Zahl ein"); | ||
alert("eingegebene Zahl: " + | alert("eingegebene Zahl: " + zahl); | ||
let | let bestaetigung = confirm(decodeURI("Bestätige die Eingabe")); | ||
if( | if(bestaetigung) { | ||
document.write("Eingabe bestätigt"); | document.write("Eingabe bestätigt"); | ||
} else { | } else { | ||
Line 399: | Line 399: | ||
<!-- Höhe und Breite abfragen --> | <!-- Höhe und Breite abfragen --> | ||
<script> | <script> | ||
let | let hoehe = window.innerHeight; | ||
let | let breite = window.innerWidth; | ||
document.write( | document.write(hoehe + "px Höhe<br>" + breite + "px Breite"); | ||
</script> | </script> | ||
</pre> | </pre> | ||
Line 416: | Line 416: | ||
//JavaScript: | //JavaScript: | ||
<script> | <script> | ||
function | function nachricht() { | ||
alert("Button vor 2 Sekunden gedrückt"); | alert("Button vor 2 Sekunden gedrückt"); | ||
} | } | ||
function start() { | function start() { | ||
setTimeout( | setTimeout(nachricht, 2000); | ||
} | } | ||
</script> | </script> | ||
Line 433: | Line 433: | ||
//JavaScript | //JavaScript | ||
<script> | <script> | ||
function | function nachricht() { | ||
alert("Button vor 2 Sekunden gedrückt"); | alert("Button vor 2 Sekunden gedrückt"); | ||
} | } | ||
function | function nachricht2() { | ||
alert("Button vor 4 Sekunden gedrückt"); | alert("Button vor 4 Sekunden gedrückt"); | ||
} | } |