selecting only the element under the cursor
Hi, I'm trying hard to select only the element under the mouse cursor, but for example, when I do this:
$(document).ready(function() {
$("div").hover(
function() {
$(this).addClass("setBorder");
},
function() {
$(this).removeClass("setBorder");
});
});
it sets the border for each div element. so if i'm hovering an inner div, it also influences the outer div:
<div><div></div></div>
I only want the div right under the cursor.
Is there a way to send the element's id to the function above? something like.. $(document).ready(function setBorder(id) {
$(id).hover(... ?