I have a child div inside of a parent div with the same class. Right now, if you hover over the child div inside the parent, a border is added to both the child and the parent. I want to make sure that only the div being hovered will get a border applied to it.
$(document).ready(function () {
$(".content").hover(function () {
$(this).parents().removeClass('divHoverBorder');
$(this).siblings().removeClass('divHoverBorder');
$(this).addClass("divHoverBorder");
$(this).parents().find(".addContentItemDiv").hide();
$(this).find(".addContentItemDiv:first").show();
}, function () {
$(this).removeClass("divHoverBorder");
$('.addContentItemDiv').hide();
});
});
<div class="content" style="width: 500px; height: 300px;">
<div class="content" style="width: 500px; height: 200px;">
</div>
</div>
Here is a JSFiddle of what I'm referring to: