Skip to main content
Home / Code Snippets / jQuery Code Snippets / Adding/Removing Class on Hover

Adding/Removing Class on Hover

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

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