title: Using a jQuery variable as an id element
body: <p>I've got a jQuery variable:</p>
  
  <pre><code>var Classofentry = $('#upload_form option[class]').attr("class");
  </code></pre>
  
  <p>which the console shows to be "animal_species" and I'd like to use it in an id reference like such:</p>
  
  <pre><code>$(Classofentry).append("&lt;option value='" + data + "'selected=\"selected\"&gt;" + data + "&lt;/option&gt;"); // This might work ...
  </code></pre>
  
  <p>(The above doesn't do the trick and is just a guess.)  I had it working hardwired as </p>
  
  <pre><code> $('#animal_species').append("&lt;option value='" + data + "'selected=\"selected\"&gt;" + data + "&lt;/option&gt;"); // This might work ...
  </code></pre>
  
  <p>where "animal_species" is the id.  Is there any way to do this?  I've also tried:</p>
  
  <pre><code>$("#".Classofentry).append("&lt;option value='" + data + "'selected=\"selected\"&gt;" + data + "&lt;/option&gt;"); // This might work ...
  </code></pre>