2012-08-23 34 views

回答

0

我認爲這個問題是DOM和jQuery之間的混淆,請嘗試使用:

$('#container').find('span').each(function() { 
    $(this).replaceWith($("<input />").val($(this).text())); 
});​ 

JS Fiddle demo

你試圖使用DOM節點this的東西,我推測,原來的代碼是jQuery text()方法(雖然括號被省略)。

+0

啊,完美。謝謝。 –

+0

非常歡迎,我很高興得到了幫助! –

相關問題