Có thể (sử dụng jQuery hay cách khác) để đặt kiểu của một phần tử nhất định theo kiểu :hover
được định nghĩa trong biểu định kiểu?Đặt kiểu phần tử thành kiểu di chuột: Sử dụng jQuery
.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");
});
'mouseOver' có thể cần phải được 'mouseover' –