我有代碼,所以當你點擊一個單詞時,它被替換爲另一個單詞。當我需要重複執行該操作時,如何綁定到單擊事件中的點擊事件?
<script>
$(document).ready(function() {
$('.note_text').click(function(){
$(this).remove();
$('#note_div').append('<span class="note_text">new</span>');
// re-applying behaviour code here
});
});
</script>
<div id="note_div">
<span class="note_text">preparing</span>
</div>
我需要附加單詞具有相同的點擊行爲。做這個的最好方式是什麼?
您的樣品我只看到文字改變......爲什麼不改變這種狀況呢? – 2011-01-25 10:47:15