Set element style to the :hover style using jQuery

Posted by Baddie on Stack Overflow See other posts from Stack Overflow or by Baddie
Published on 2010-05-20T15:44:48Z Indexed on 2010/05/20 15:50 UTC
Read the original article Hit count: 199

Filed under:
|

Is it possible (using jQuery or otherwise) to set the style of a certain element to the :hover style defined in a stylesheet?

.regStyle {
   background-color: #000;
}

.regStyle:hover {
   background-color: #fff;
} 

Trying it out

$("#differentButton").click(function(){
    // this doesn't work 
    $("#someElement").addClass("regStyle:hover").remove("regStyle");
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about css