change the value of the button of the button clicked
<p>On inserting the new <code>&lt;li&gt;</code>, I have to set the value of the button clicked to Delete. How can I do that? </p>

<p>With the actual code, it`s working only once, and on adding other list, the button no more has the the value 'Delete'.    </p>

<pre><code>$("#mylist :button").click( function() { 
    var text = $(this).val(); 

    if (text == "Delete") { 
        $(this).parent().remove(); 
    } else { 
        $(this).val("Delete"); 
    }
});

$("#mylist li:last-child").live('click', function() { 
    $(this).parent().append('&lt;li&gt;' + '&lt;input type = "textbox"&gt;' + 
        '&lt;input type = "button" value= "Save"&gt;' + '&lt;/li&gt;');
});

&lt;div&gt;
    &lt;ul id="mylist"&gt;
        &lt;li id="1"&gt;1&lt;button id="Button3"&gt;Delete&lt;/button&gt; &lt;/li&gt; 
        &lt;li id="2"&gt;2&lt;button id="Button2"&gt;Delete&lt;/button&gt;&lt;/li&gt; 
        &lt;li id="3"&gt;3&lt;button id="another_entry"&gt;Save&lt;/button&gt;&lt;/li&gt;
    &lt;/ul&gt;
</code></pre>
