Drkosh Drkosh - 1 month ago 5x
jQuery Question

How to dynamic select element with JQuery by id

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.