jquery/javascript finding the value within a dynamically created element id
<p>I have a dynamically generated html table whose columns have id assigned dynamically. 
for ex: </p>

<pre><code>   &lt;td id="1"&gt;1&lt;/td&gt;
    &lt;td id="2"&gt;2&lt;/td&gt;
     ....
     ....
   &lt;td id="n"&gt;n&lt;/td&gt;
</code></pre>

<p>in order to get the get value of a specific column I am using
        <code>document.getElementById("#myvar").innerHTML</code> or <code>$("td#myvar").html</code> where myvar is variable that contains search element such as   2 or 3 etc. But I dont get any results. If I direcly use a number for <code>document.getElementById("#2").innerHTML</code> , it works. Please advise what to do to get value where id of element is same as the variable declared??</p>
