JQuery Append Html onclick function
<p>Im trying to remove the text box evenly. I mean for each textbox i want the remove button.If i click the remove button i want to delete the textbox</p>

<p>Html for adding multiple text box</p>

<pre><code>&lt;pre&gt;&lt;div id="TextBoxDiv1"&gt;
                    &lt;label style="float: none;"&gt; Bus Model &amp;nbsp;&amp;nbsp;&amp;nbsp;
                    &lt;input style="width: 150px;" type="text" value="" class="validate[required,custom[onlyNumberSp]]" name="numsValid" id="numsValid"&gt;
                    &lt;img src="images/india_rupess.png" style="margin-left:18px;"&gt; :&lt;/label&gt;
                    &lt;input style="width: 150px;" type="text" value="" class="validate[required,custom[onlyNumberSp]]" name="numsValid" id="numsValid"&gt;
                    &lt;label style="float: none;margin-left: 16px;"&gt;&lt;span class="font-dollar"&gt;﹩&lt;/span&gt;&amp;nbsp; :&lt;/label&gt;
                    &lt;input style="width: 150px;" type="text" value="" class="validate[required,custom[onlyNumberSp]]" name="numsValid" id="numsValid"&gt;
                    &amp;nbsp;&amp;nbsp;&lt;a href="javascript:;" id="addButton"&gt;Add&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="javascript:;" id="removeButton"&gt;Remove&lt;/a&gt;
                    &lt;/div&gt;&lt;/pre&gt;
</code></pre>

<p>This is my script</p>

<pre><code>&lt;pre&gt;var counter = 2;
$("#addButton").click(function () {


    $("#TextBoxesGroup").append('&lt;div id="TextBoxDiv'  + counter +   '" class="textadd""&gt;&lt;label style="float: none;"&gt; Bus Model &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;input style="width: 150px;margin-left:3px;" type="text" value="" class="validate[required,custom[onlyNumberSp]]" name="bus' + counter +   '" id="numsValid"&gt;&lt;img src="images/india_rupess.png" style="margin-left:21px;"&gt; :&lt;/label&gt;&lt;input style="width: 150px;margin-left:3px;" type="text" value="" class="validate[required,custom[onlyNumberSp]]"  name="rs' + counter +   '" id="numsValid"&gt;&lt;label style="float: none;margin-left: 19px;"&gt;&lt;span class="font-dollar"&gt;﹩&lt;/span&gt;&amp;nbsp; :&lt;/label&gt;&lt;input style="width: 150px;margin-left:2px;" type="text" value="" class="validate[required,custom[onlyNumberSp]]"  name="dollar' + counter + '" id="numsValid"&gt;&amp;nbsp;&amp;nbsp;&lt;a href="javascript:;" onClick="javascript:alert("test");"   &gt;Remove&lt;/a&gt;&lt;/div&gt;');

counter++;;
</code></pre>

<p>}); </p>

<p>Click to view <a href="http://jsfiddle.net/b8DRT/" rel="nofollow">http://jsfiddle.net/b8DRT/</a></p>
