Timothy Ruhle Timothy Ruhle - 1 month ago 5
jQuery Question

jQuery remove table row with non-standard id characters

I am trying to remove a table row using jQuery like this

function removeTableRow(trId){
$('#' + trId).remove();
}


However this doesn't work if the id contains a character like "%", "^", "&", ",", etc....

Do you know if there is any work around for this?

Answer

I believe the reason why can be found here: What is a valid value for id attributes in html

However I'm not so sure about a workaround other than the obvious (change your ids)