在鼠标悬停时在单元格中添加粉红色边框
let TH = documenter code hereent.getElementsByTagName('th');
for (i = 0; i < TH.length; i++) {
TH[i].addEventListener('mouseover', function(e){
if(e.target) {
this.style.border = '5px solid pink';
} else {
this.style.border = 'none';
}
});
}
当我将鼠标移出时,它仍然是相同的粉红色(边框)。如何解决?
$( "td" ).hover(
function() {
$( this ).addClass( "hover" );
}, function() {
$( this ).removeClass( "hover" );
}
);
//then you can add specific style for hover on a css file