javascript - How do I bind to the click event from within the click event when I need to do it repeatedly? -
i've got code when click on word, replaced word.
<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>
i need appended word have same click behaviour. best way this?
change
$('.note_text').click(function(){
to
$('.note_text').live('click',function(){
this cause on page ever gets class 'note_text' have behaviour set .live
Comments
Post a Comment