我有一個無序列表如下:使用jQuery添加列表標題
<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>
我想使用jQuery來產生這樣的:
<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>
我當前的代碼看起來liket他的,但我不能不能讓它工作。幫助任何人? :)
$('.blueBoxMid li').each(function(){
$('.blueBoxMid li em').hide();
$('.blueBoxMid li').attr('title', $(this).children('em').text()).hover(function(){$(this).css('cursor', 'help')});
});
其在這裏工作...與jquery 1.3.2 你面臨的問題是什麼? – 2009-08-12 08:30:36