I've updated your fiddle:
$(document).on('mouseover', '#message', function () {
$(this).find('.myClass').removeClass('hideIt');
}).on('mouseout', '#message', function() {
$(this).find('.myClass').addClass('hideIt');
})
$('#message .myClass').on('click', test);
I moved the click
and mouseout
event handlers outside of the mouseover
handler
Edit: oops, I forgot to add #message to the 2nd .on()