Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery remove() for removing object by variable

Tags:

jquery

I'm trying to do something like this:

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);
 });

Why does append() work but remove() throws a type error?:

TypeError: expr.replace is not a function
Line: expr = expr.replace(rattributeQuotes, "='$1']" );     jquery.js
like image 227
parliament Avatar asked Dec 26 '22 09:12

parliament


1 Answers

Try this out

$(rowResult).on("click", "button.removeButton", function()  { 
       $(rowResult, "ul#filesList").remove();
});
like image 172
writeToBhuwan Avatar answered Jan 08 '23 05:01

writeToBhuwan