Register Mouseenter and mouseleave with on() - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:mouseenter

Description

Register Mouseenter and mouseleave with on()

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//  ww w  .ja v a 2  s  .c o m
$('.flash').on({
    mouseenter: function() {
        $('.flashOn').hide();
    },
    mouseleave: function() {
        $('.flashOn').show();
    }
});
    });

      </script> 
 </head> 
 <body> 
  <p class="flash">Flash</p> 
  <p class="flashOn">FlashOn</p>  
 </body>
</html>

Related Tutorials