I need to dynamic select element with JQuery, I get in code id of element. How to do that ? I've tried:
var sel='\'#'+id+'\'';
var elem+$(sel);
but it doesn't work ( id is string id of element).
You would use code such as
var ID = 'whatEver';
$('#' + ID).action();
You would then be able to use that to select whatever element you are after.
You don't need the extra quotes. Just:
var elem = $("#"+id);
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