On mouse out add class, remove class
Hi Jake;
On mouse over I want to add btn-primary and remove btn-default. It works fine but on mouse out I want to remove class btn-primary and add class btn-default.
The second part doesn't work! I wonder what I am doing wrong.
Thanks
- $( ".btn-default" ).mouseover(function()
- {
- $(this).addClass("btn-primary");
- $(this).removeClass("btn-default hovered");
- });
-
- $( ".btn-primary" ).mouseout(function()
- {
- alert('out');
- $(this).removeClass("btn-primary");
- $(this).addClass("btn-default");
- });