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