jQuery implements mouse over add and remove class methods

  • 2020-06-22 23:49:14
  • OfStack

This article illustrates jQuery's approach to adding and removing class by mouse-over. Share to everybody for everybody reference. Specific implementation methods are as follows:


$('#elm').hover(
    function(){
     $(this).addClass('hover')
    },
    function(){
     $(this).removeClass('hover')
    }
)

Hopefully, this article has been helpful in your jQuery programming.


Related articles: