也許noobie關於keyup函數的問題,如果文檔準備好了,那麼id爲「testdiv」的div是不應該是空的。如果你真的關鍵,我希望testdiv爲空。我做了這樣一個小腳本:在jQuery中關鍵問題
<script>
$(document).ready(function(){
$('#test:input').keyup(function() {
$('#testdiv').empty();
}).keyup();
});
</script>
<input type="textfield" id="test" value="test123"/>
<div id="testdiv">Test</div>
我必須綁定它嗎?對於這個初學者問題抱歉。
問候,
弗蘭克
Keyup是麻煩! – Raynos 2011-02-01 13:08:24