[jQuery] How to use dynamic id in selectors

[jQuery] How to use dynamic id in selectors


I generate ids for span and divs in my code. So Ids are stored in js
variables.
How do I use it in selector?
elementid is a js variable which has the id of a span element. The
following does not seem to be working...
$(elementid).progressbar().progressbar("progress", status);