Ok, I would like to add the cfse_a class to the cfse_a element when the mouse is overhanging the element, and then when the mouse is not hovering over the element, then remove the cfse_a class.
cfse_a
Use the hover event addClass and removeClass :
hover
addClass
removeClass
$("#searchput").hover(function() { $(this).addClass("cfse_a"); }, function() { $(this).removeClass("cfse_a"); });
DEMO: http://jsfiddle.net/G23EA/
$('#searchput').hover(function() { $(this).addClass('cfse_a'); // add class when mouseover happen }, function() { $(this).removeClass('cfse_a'); // remove class when mouseout happen });
You can also use:
$('#searchput').hover(function() { $(this).toggleClass('cfse_a'); });
see toggleClass ()
Demo
Use it.hope, it will help!
Hope this helps.
$('#searchput').mouseover(function() { $(this).addClass('cfse_a'); }).mouseout(function(){ $(this).removeClass('cfse_a'); });