<!DOCTYPE html>
<html lang="en-US">
<body>
<p>Place the cursor over me</p>
<script>
var x = document.getElementsByTagName("p")[0];
function myFunction(){
document.write("You placed");
}
x.addEventListener("mouseover", myFunction);
</script> </body>
</html>