$(document).ready(function() {
function showSpan() {
$(this).find('span').slideToggle();
}
$('div.test').on('mouseenter', 'li', showSpan);
});
When jQuery calls a handler, the this keyword is a reference to the element where the event is being delivered; for directly bound events this is the element where the event was attached and for delegated events this is an element matching selector. (Note that this may not be equal to event.target if the event has bubbled from a descendant element.) To create a jQuery object from the element so that it can be used with jQuery methods, use $( this ).