Timothy Ruhle Timothy Ruhle - 6 months ago 35
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?


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)