jQuery Mouse Events Last Updated : 13 Jun, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report This article will explain different mouse events occurring based on mouse positions on a particular HTML element. Mouse Events in jQuery: mouseenter and mouseleave mouseup and mousedown mouseover and mouseout mouseenter and mouseleave: The mouseenter event occurs when the mouse is placed over the HTML element and mouseleave event occurs when the mouse is removed from the element. JavaScript <!DOCTYPE html> <html> <head> <script src="jquery.js"></script> </head> <body bgcolor="cyan"> <p id="key">Original Text</p> <script> $("document").ready(function () { $("#key").mouseenter(enter); $("#key").mouseleave(leave); function enter() { $("#key").text( "mouseenter event has occurred"); } function leave() { $("#key").text( "mouseleave event has occurred"); } }); </script> </body> </html> Output: On loading the webpage: MouseEnter and MouseLeave events: MouseUp and MouseDown events: mouseup and mousedown requires a mouse-click to occur. JavaScript <html> <body bgcolor="#ff00ff"> <p id="key">Original Text</p> </body> <script src = "jquery.js"></script> <script> $("document").ready(function() { $("#key").mouseup(up); $("#key").mousedown(down); function up() { $("#key").text("mouseup event has occurred"); } function down() { $("#key").text("mousedown event has occurred"); } }); </script> </html> Output: On landing web page: MouseUp and MouseDown events: Mouseover and Mouseout: These events occur when the mouse is placed over some specific HTML element. JavaScript <html> <body bgcolor="#87FF2A"> <p id="key">Original Text</p> </body> <script src = "jquery.js"></script> <script> $("document").ready(function() { $("#key").mouseover(over); $("#key").mouseout(out); function over() { $("#key").text("mouseover event has occurred"); } function out() { $("#key").text("mouseout event has occurred"); } }); </script> </html> Output: Onloading web page: MouseOver and MouseOut events: Comment More infoAdvertise with us Next Article jQuery Mobile vmousedown Event C chakradhar_chinni Follow Improve Article Tags : Web Technologies JQuery jQuery-Events Similar Reads jQuery Events jQuery events are actions or occurrences that happen on a web page, such as clicks, hover, or keypress. jQuery provides methods to handle and respond to these events with ease. jQuery events are used to create dynamic web pages. Syntax: $(selector).method(function)Here We will explore some basic eve 4 min read jQuery Mobile vmouseup Event jQuery Mobile vmouseup event is fired when we click and release the mouse on the element. We can use this event for our different purposes. Syntax: jQuery(".selector").on( "vmouseup", function( event ) { } ) Approach: First, add jQuery Mobile scripts needed for your project. <link rel="stylesheet 1 min read jQuery Mobile vmouseout Event jQuery Mobile vmouseout event is fired when we hover and take the mouse out of the element area. We can use this event for different purpose. Syntax: jQuery( ".selector" ).on( "vmouseout", function( event ) { } ) Approach: First, add jQuery Mobile scripts needed for your project. <link rel="style 1 min read jQuery Mobile vmousemove Event jQuery Mobile vmousemove event is fired when we move the mouse in the element area. We can use this event for different purposes. Syntax: jQuery(".selector" ).on( "vmousemove", function( event ) { }) Approach: First, add jQuery mobile scripts needed for your project. <link rel="stylesheet" href=" 1 min read jQuery Mobile vmousedown Event jQuery Mobile vmousedown event is fired when we click on the element. We can use this event for different purposes. Syntax: jQuery( ".selector" ).on( "vmousedown", function( event ) { } ) Approach: First, add jQuery Mobile scripts needed for your project. <link rel="stylesheet" href="http://code. 1 min read jQuery Mobile vmouseover Event jQuery Mobile vmouseover event is fired when we hover the mouse over an element. We can use this event for our different purposes. Syntax: jQuery( ".selector" ).on( "vmouseover", function( event ) { } ) Approach: First, add jQuery Mobile scripts needed for your project. <link rel="stylesheet" hre 1 min read Like