TUTORIALS

jQuery Program to show mouse pointer position

Written By: Chaitra M
Created at: 28-June-2023 20:36:19
Modified at: 28-June-2023 20:36:39

Program


<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.min.js"></script>
<script>
	$(document).ready(function() {
		$(document).mousemove(function(event) {
			$("span").text("X: " + event.pageX + ", Y: " + event.pageY);
		});
	});
</script>
</head>
<body>

	<p>
		The mouse pointer position is at: <span></span>
	</p>

</body>
</html>

Output



The mouse pointer position is at:

There are no likes. Be the first one to like
Likes: 0
Comments: 0