trigger the mousemove event for the selected elements: - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:mousemove

Description

trigger the mousemove event for the selected elements:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("p").mousemove(function(){
        $("p").css("background-color", "lavender");
    });//w w  w  .ja  va2 s .  c o  m
    $("button").click(function(){
        $("p").mousemove();
    });
});
</script>
</head>
<body>

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

<button>Trigger mousemove event</button>

</body>
</html>

Related Tutorials