title: create Html elements using jquery
body: <p>how can I create something like below div using jquery? preferably using something similar to <code>$(document.createElement('div'));</code> or something faster apart from <code>$("&lt;div spry:region="myDs"&gt;{hostname}&lt;/div&gt;");</code></p>
  
  <pre><code>&lt;div spry:region="myDs"&gt;
      {hostname}
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Edited</strong></p>
  
  <p>How to put this code in another JS file and use it, coz <code>"&lt;%= request.getParameter(\"filepath\") %&gt;"</code> is creating problem </p>
  
  <pre><code>var cpath="&lt;%= request.getParameter(\"filepath\") %&gt;";
  var myDs = new Spry.Data.XMLDataSet(cpath, "csmclient/system");     
  $(document).ready(function(){
      $('&lt;div&gt;')                      // Creates the element
      .attr('spry:region','myDs') // Sets the attribute spry:region="myDs"
      .html('{hostname}')         // Sets the inner HTML to {hostname}
      .appendTo('body');
  });
  </code></pre>