我嘗試構建自己的選擇器,但出現錯誤。構建選擇器
螢火告訴我:
丟失)後的參數列表
$("#for_" + $(this)attr('id') + "").click(function() {
alert($(this).attr("id"));
});
能有人幫助我plaese?
我嘗試構建自己的選擇器,但出現錯誤。構建選擇器
螢火告訴我:
丟失)後的參數列表
$("#for_" + $(this)attr('id') + "").click(function() {
alert($(this).attr("id"));
});
能有人幫助我plaese?
$("#for_" + $(this)attr('id') + "").click(function() {
^---
你錯過了.
。在指定的地點。應該
$("#for_" + $(this).attr('id') + "").click(function() {
哦,我...我必須去睡覺!謝謝!! – fteinz
$("#for_" + $(this).attr('id')).click(function() {
alert($(this).attr("id"));
});
Didnt你忘了 「」 attr之前?
'$(this)attr('id')'是一個語法錯誤。您可能需要'$(this).attr('id')'(或簡單地說'this.id')。 –