I want buttons to be displayed once, not twice
<p>I have 2 buttons which are both displayed twice like below:</p>

<pre><code>Button 1 (Performs the onclick='SelectAll(this)')
Button 1 (Performs the onclick='RemoveAll(this)')

Button 2 (Performs the onclick='SelectAll(this)')
Button 2 (Performs the onclick='RemoveAll(this)')
</code></pre>

<p>Both Button 1 and Button 2 should appear once like below:</p>

<pre><code>Button 1 (Performs the onclick='SelectAll(this)')
Button 2 (Performs the onclick='RemoveAll(this)')
</code></pre>

<p>How can I achieve this above:</p>

<p>The code which displays these buttons are below:</p>

<pre><code>function insertButton(form) {   


var $answer = $("&lt;table class='answer'&gt;&lt;/table&gt;");

$('.buttonOne:first, .buttonTwo:first').each(function() {
        var $this = $(this);
        var $BtnsClass = '';

        $row = $("&lt;tr/&gt;").appendTo($answer);
        $cell = $("&lt;td/&gt;").appendTo($row);


        $BtnsClass = $("&lt;input class='buttonOne btnsAll' type='button' style='display: block;' value='Button 1' onClick='selectAll(this);' /&gt;
        &lt;br/&gt;
        &lt;input class='buttonTwo btnsRemove' type='button' style='display: block;' value='Button 2' onClick='removeAll(this);' /&gt;")
        .attr('name', $this.attr('name')).attr('value', $this.val()).attr('class', $this.attr('class'));

        $BtnsClass.appendTo($cell);

    });  

        $tr.append($answer);

        }   
</code></pre>

<p>Below is the html where the buttons in the jquery should match to</p>

<pre><code>&lt;p&gt;&lt;input class="buttonOne btnsAll" name="allBtnsName" type="button" value="Button 1" onClick="selectAll(this);" /&gt;
&lt;br/&gt;&lt;input class="buttonTwo btnsRemove" name="allRemoveBtnsName" type="button" value="Button 2" onClick="removeAll(this);" /&gt;&lt;/p&gt;
</code></pre>

<p>The html buttons only display each button once which is fine, so why is the jquery displaying the buttons twice and not once?</p>
