2011-09-19 93 views
1

我需要jquery才能在下面的代碼中獲取點擊鏈接的html。通常情況下,我可以得到它。但是這次畫布標籤給我帶來了問題。誰能幫我這個?jQuery獲取點擊鏈接的html

<div height="250" width="250" style="float:relative; margin-bottom: 20px;margin-left: 20px" id="panel" name="panel" class="panel"> 

<canvas height="250" width="250" class="canvas" name=canvas" id="canvas"> 

<ul id="Comments" style="font-size: 50%;" class="Reg_Comments"> 

<li><a mthyear="August-2010" href="#" name="comments01">fast</a></li> 
</ul> 

</div> 
+0

請發表您的代碼和詳細的任何調試信息或錯誤信息。否則,我們將無法提供幫助。 –

回答

1

關閉畫布標籤或更改您的html。

很確定,因爲你格式不好的HTML,這會導致你的問題。

0

yup ..帆布標籤似乎不被關閉。
而上單擊HTML應該是一個簡單的通話 -

$('a').click(function(){ 
    alert($(this).html()); 
});