how to create own function and call it another function? like-
$('.mycls li').hover(function() {
var divid = $(this).find('li').attr('some_attr');
call myfunc(divid);
});
function myfunc(divid)
{
$(divid).show();
//I want to hide rest all divs
$('div#info1').hide();
$('div#info2').hide();
$('div#info3').hide();
}
I have 2 questions one is how to implement this logic in jquery second is which attribute can be used to reference the specific li to specific div
my divs are as-
<div id="info1">
//some information
</div>
<div id="info2">
</div>
....