This may be a simple question. I need to access an html element using jQuery in the following way:
var element_ID = "my" + "name" +"xyz";
Now I want to access/manipulate the element whose ID I have stored in 'element_ID' as above.
This doesn't work : $('#element_ID')
Please let me know the correct way to access the element stored 'element_ID' variable.
-Vijay
Just use string concatenation once more...
$('#' + element_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