Javascript Add/Remove textbox and corresponding delete button
<p>How can I dynamically add/remove textbox (not clearing the data of textbox) and corresponding delete button on corresponding delete button click event through javascript?</p>

<p>NOTE:There is separate button for every dynamically created textbox.</p>

<p>Below is my javascript function. I'm using jQuery 1.3.2</p>

<pre><code>function addOption()
{
        var d=document.getElementById("yash");
        d.innerHTML+="&lt;input type='text' id='mytextbox' name='textbox' class='form-field medium' &gt;";
        d.innerHTML+="&lt;input type='button' id='mybutton' name='del'&gt;";      
        $("#mybutton").click(function () {
            $("#mytextbox").remove();
            $(this).remove();
        });
        d.innerHTML+="&lt;br/&gt;";

}
</code></pre>
