Adding/Removing Class on Hover

Submitted by:Tom Hanks

Date added:22 January, 2011

Category:jQuery

This will work in any browser on any element, to support styling changes on hover.

Tags: jquery , removing class on hover , adding class on hover

Code Snippet:

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

Comments