I have an unordered list like this:
<div class="blueBoxMid">
<ul>
<li>First item <em>This is the hover text</em></li>
<li>Second item <em>This is the hover text</em></li>
</ul>
</div>
I want to use jQuery to generate this:
<div class="blueBoxMid">
<ul>
<li title="This is the hover text">First item</li>
<li title="This is the hover text">Second item</li>
</ul>
</div>
My current code looks liket his, but I couldn't get it to work. Help anyone? :)
$('.blueBoxMid li').each(function(){
$('.blueBoxMid li em').hide();
$('.blueBoxMid li').attr('title', $(this).children('em').text()).hover(function(){$(this).css('cursor', 'help')});
});