jQuery remove() for removing object by variable
<p>I'm trying to do something like this:</p>

<pre><code>var rowResult = $(template(data)).find(".progressBar").progressbar({ value : 0 }).end();
this.jQueryDialog.find("ul#filesList").append(rowResult); 

$(rowResult).on("click", "button.removeButton", function()  { 
       $("ul#filesList").remove(rowResult);
 });
</code></pre>

<p>Why does append() work but remove() throws a type error?:</p>

<pre><code>TypeError: expr.replace is not a function
Line: expr = expr.replace(rattributeQuotes, "='$1']" );     jquery.js
</code></pre>
