Jquery addClass and Remove Class on hover

file, javascript, jquery

Solution

Use `hover` event with `addClass` and `removeClass` methods:

$("#searchput").hover(function() {
    $(this).addClass("cfse_a");
}, function() {
    $(this).removeClass("cfse_a");
});

DEMO: http://jsfiddle.net/G23EA/

Problem

Okay i would like to add a class `cfse_a` to an element `#searchput` when the mouse is hovering over the element and then when the mouse is not hovering over the element then remove class `cfse_a`.

Original source