when mouseover #divlayer
, find()
id of child span
<div id="divlayer">
<p>title</p>
<span id="apple">apple</span>
<span id="orange">orange</span>
<span id="kiwi">kiwi</span>
</div>
$('span').hide();
$('#divlayer').mouseover(function(){
$('span').show();
$(this).find(???).attr('id');
});
edit: my bad, I should have clarified my question. the span
children are hidden, when the mouse pointer goes over <p>title</p>
, id of each span
child is returned.
Basically, <p>title</p>
is visible at first, and when the mouse goes over the it, children are shown and ids are returned individually.