Display Key name on a key pressed using Event object.
CODING:
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction(event) {
x = event.key;
alert("You Pressed =" + x);
}
</script>
</head>
<body onkeyup="myFunction(event)">
<h1> Any one Key Press on your Keyboard.</h1>
</body>
</html>
CODING:
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction(event) {
x = event.key;
alert("You Pressed =" + x);
}
</script>
</head>
<body onkeyup="myFunction(event)">
<h1> Any one Key Press on your Keyboard.</h1>
</body>
</html>
Comments
Post a Comment