Menu
Hello. I try to retrieve the position of the typed text character with event.screenX and event.screenY values via a keypress event listener but it doesnt help. What am I doing wrong? Code is below.
[code=php]
<html>
<head>
<title>Trial</title>
<script type=”text/javascript”>
window.onload=function () {
document.getElementById(“main”).addEventListener(“keypress”,function (event) {
alert(event.screenX);
},true);
}
</script>
</head>
<body >
<textarea id=”main” >
</textarea>
</body>
</html>