2011-12-04 13 views
5

我得到的錯誤類型錯誤HTMLSpanElement有沒有方法「HTML」

Uncaught TypeError: Object #<HTMLSpanElement> has no method 'html' 

當我運行這個方法

$("input[name=advancedSettings]").change(function() { 
    $('span[id^="sFile"]').each(function() { 
    this.html('Hey'); 
    }); 
}); 

和跨度當然應該呼籲文本和HTML的方法,我有測試了

回答

18

你應該jQuery對象上運行.html()

$(this).html('Hey'); 
+0

哦,我忘了美元符號和parentes,我已經嘗試了很多其他的東西 – The87Boy

相關問題