When hovering over a field on a table I'm appending a div to that field and showing some text in the newly added field (a tooltip). When hovering out the table field I want it to be closed, but I want it to remain open as long as I'm within it child element (the newly added div). It works fine on Chrome but not in FF/IE
$(document).ready(init);
function init(){
$('table td.column_5').on('mouseover', show_tooltip);
$('.tooltip, table td.column_5').on('mouseout',remove_tooltip);
}
function show_tooltip(e){
if ($(e.target).text() !== '' && !$(this).children().hasClass('tooltip')){
var tooltip = '<div class="tooltip">'+$(e.target).text()+'</div>';
$(this).append(tooltip);
}
}
function remove_tooltip(e){
if ($(this).children().hasClass('tooltip') && !$(this).children('.tooltip').is(':hover')){
$('.tooltip').remove();
}