td.onmouseout = function (event) { if (((event = event || window.event).target || event.srcElement).className.indexOf("own") === -1) { // Ваша функция } }