Jquery - remove item identified by ID passed in through function : <p>I have an HTML list, in its simplest form:</p>

<pre><code>&lt;div class="row" id="row-31"&gt;
    &lt;div class="col-lg-12"&gt;
       &lt;button onClick="removeRow('row-31')"&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>And in my scripts:</p>

<pre><code>function removeRow(row){
    console.log(row);
    ('#' + row).remove();
}
</code></pre>

<p>Inside the JS, I've also tried <code>(row).remove();</code>, etc. I log the correct row ID to remove, but i can't get it to disappear.</p>

<p>Before moving it to a function, I could delete the row using <code>$(this).parent().parent().remove();</code> (since the button is in an enclosing div - bootstrap row and col), but the problem was, since the user can create new rows, the script wasn't binding to the dynamically created button, so I moved it into a function. Now the script fires, but it can't remove an item by it's ID.</p>

<p>Can anyone give me a pointer, please?</p>

<p>I can either get this to work 90% of the way or 10% of the way, but not 100% :)</p>

<p>(if it matters, the row ID is being generated by PHP, but I don't think that's the issue)</p>
