Created
July 21, 2019 12:06
-
-
Save eladrkatz/89075c0a3a10711d7a068e19a17c302d to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/rokerubega
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id='hoverElement'> | |
Hover Me! | |
</div> | |
<div id='resultElement'> | |
</div> | |
<script> | |
window.addEventListener('load', () => { | |
const hoverElement = document.getElementById('hoverElement'); | |
//console.log(hoverElement); | |
hoverElement.addEventListener('mousemove', (e) => { | |
//console.log(e); | |
const resultElement = document.getElementById('resultElement'); | |
resultElement.innerText = `${e.clientX} : ${e.clientY}`; | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment