Q: search dynamically created row and delete I am trying to search a particular row having userName which is created dynamically by another function and remove it from the table.But I am now able to search the row.
This is how I am adding a new row:
$("table").append("<tr><td>" + userName + "</td></tr>");

and this is how I am searching the table for the row having userName and removing it:
$("table").find("<tr><td>" + userName + "</td></tr>").remove();


A: The argument to find is a selector, not HTML.
$("table").find("td:contains("+userName+")").remove();


A: Use contains() based selector
$('table td:contains('+userName+')').remove()

or
$('table').find('td:contains('+userName+')').remove()

Fiddle
Your code was not the right way to find existing DOM children.
For exact match use .filter(),
$("table td").filter(function() {
    return $(this).text() === userName;
}).remove()


A: you can use contains() function in selector, see below sample code
$("table").find("tr > td:contains('"+ userName +"')").remove();


A: Even you try with jQuery closest.
$('table').closest('tr').remove();

