mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
c5569ccb27
It does not work well yet.
21 lines
412 B
HTML
21 lines
412 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
|
|
<p>A function is triggered when the user is pressing a key in the input field.</p>
|
|
|
|
<form action="/">
|
|
<input id="k" type="text">
|
|
<input type="submit">
|
|
</form>
|
|
<script>
|
|
function myFunction(event)
|
|
{
|
|
alert("You pressed a key with code " + event.keyCode + " inside the input field");
|
|
}
|
|
|
|
document.getElementById('k').addEventListener('keydown', myFunction);
|
|
</script>
|
|
</body>
|
|
</html>
|