jQuery mousemove() handle mouse move event

Description

jQuery mousemove() handle mouse move event

View in separate window

<!DOCTYPE html>
<html>
<head>
<script 
 src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>//  w ww .  j  a v  a2 s . c  om
<script>
$(document).ready(function(){
  $("p").mousemove(function(){
    $("p").css("background-color", "lavender");
  });
  $("button").click(function(){
    $("p").mousemove();
  });
});
</script>
</head>
<body>

<p>This is a paragraph.</p>

<button>Trigger mousemove event</button>

</body>
</html>



PreviousNext

Related