what's the more elegant way to use an id already set? jQuery("#"+ t)?
<p>i'm kinda of a newbie in javascript, even though i built so far lots of working website and apps..</p>

<p>btu i feel naive the way i used to pass the variable id to jquery..
for instance i used to do like this epsecialy when i have to work with some old code
..
let's assume that i have all my website already coded with 'a' tags like this</p>

<pre><code>&lt;a id='myId' onclick='doSome(this.id)' &gt; link &lt;/a&gt;
</code></pre>

<p>and then in JS</p>

<pre><code>function doSome(id){

//old code removed and replaced by jquery
    jQuery("#"+ id).show();

}
</code></pre>

<p>and the function in that way works flawless...</p>

<p>so, again, assuming that i cannot change anything else than the code inside the function what's the best way to use the variable id?
because as far as i know if I had used just</p>

<pre><code>jQuery(id).show();
</code></pre>

<p>instead of</p>

<pre><code>jQuery("#"+ id).show();
</code></pre>

<p>it wouldn't have worked...right?</p>
