title: Passing vars in jQuery function
body: <p>I am creating a jquery function, but i have a problem passing some vars to my function.
  This is what i am tring to do, i resumed my code below:</p>
  
  <pre><code>var func = "appendTo";
  var myid = "thisismyid";
  var element = "div";
  $("&lt;"+element+"/&gt;"{if(myid != ''){ id:myid}}).func($elem);
  </code></pre>
  
  <p>There's a way to do that?
  This is the only working code that i can get:</p>
  
  <pre><code>$("&lt;"+element+"/&gt;").appendTo($elem);
  </code></pre>
  
  <p>Thank you in advance.</p>