Situation:
there is an element
<span class="edit">текст</span>
and there is a handler
$('.edit').click(function() { $(this).addClass('absolute').removeClass('edit'); $(this).html('<input type="text" value="'+$(this).text()+'"><input class="ok" type="button" value="ok">'); });
when you first click on an element, which is logical, an input with the same content and an "ok" button appear inside it. however, when you click on an element again (on an input or a button), the same event appears, and an input is created anew with a button, instead of these, with an empty value, although the class "edit" from which the event fires, was removed.
Where is the error in my reasoning? why it happens?