title: How to create a DOM node as an object?
body: <p>I would like to create a DOM node, set the 'id' attribute and then append it to 'body'. The following seems not to work because jQuery doesn't see my template as an object:</p>
  
  <pre><code>var template = "&lt;li&gt;&lt;div class='bar'&gt;bla&lt;/div&gt;&lt;/li&gt;";
  template.find('li').attr('id','1234');
  $(body).append(template);
  </code></pre>
  
  <p>How can I tell jQuery to treat this as an object so find() works on it?</p>