You should check if the offset X and offsetY are less than the width of the border, and if you are on the border, also check if the offsetX value is greater than innerWidth or offsetY is greater than innerHeight
$('td').hover(function(e){
var border_width = parseInt($(this).css('border-width'));
if(e.offsetX < border_width || e.offsetX > $(this).innerWidth() || e.offsetY < border_width || e.offsetY > $(this).innerHeight()){
console.log('This is the border');
}
});
Here jsFiddle
source
share