<html>
<head>
<script>
function showDialog(){
console.log("A key was pressed down");
}
</script>
</head>
<body>
<form name="myForm">
<textarea name="myTextArea" rows=2 cols=50 onKeyDown='showDialog()'>
Here is some text in my text area.
</textarea>
</form>
</body>
</html>