1
0
mirror of https://github.com/Pathduck/pathduck.github.io.git synced 2025-12-29 11:45:20 -05:00
Files
pathduck.github.io/test/preventdefault/index.html
2025-06-01 11:43:10 +02:00

26 lines
718 B
HTML
Executable File

<!DOCTYPE html>
<html>
<head>
<title>Vivaldi Fast Forward vs. preventDefault()</title>
<style>body {color: white; background: darkslategray;} a {color: deepskyblue;};</style>
</head>
<body>
<p>You cannot use Space inside the input:</p>
<p><input autofocus></p>
<p>Press ESC to escape the input and press Space.</code></p>
<p>The link should not be followed if Space is blocked by <code>event.preventDefault()</code> - or should it?</p>
<p><a href="https://example.com/" rel="next">Next</a></p>
<script>
window.onkeydown = function (event) {
if (event.keyCode === 32) {
event.preventDefault();
//event.stopImmediatePropagation();
//event.stopPropagation();
}
};
</script>
</body>
</html>