I've stored the id of an element as a string, I want to get it using a jquery selector, like:
var theid = $('#test').attr('id');
... later ...
$(theid).remove();
what's the right syntax for running the selector using the string variable which contains the id of the element I want to remove?
Thanks
$('#'+theid).remove()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With