Reputation:
I'm trying to add a border bottom in Jquery and this block of code does not work :
$('div#tableContent div.slot div.desc h2 a').on(function() {
$(this).css("border-bottom","1px solid #FFF");
});
$('div#tableContent div.slot div.desc h2 a').mouseleave(function() {
$(this).css("border-bottom","none");
});
Is it because i'm using Jquery 1.8 and IE 8 ? thanks in advance for your help
Upvotes: 0
Views: 484
Reputation: 74738
You are missing the event type in your first code block here:
.on('mouseenter', function() {
//---^^^^^^^^^^^----this event type is missing
Why bother to do this with js, you can achieve this with css:
div#tableContent div.slot div.desc h2 a:hover{
border-bottom : 1px solid #FFF;
}
Upvotes: 1