short question:

what is the recommanded/better/fastest (memory footprint/execution time)
jQuery way to create dynamic content?
the length of code is not so important for me. 
or should i use one of the DOM creation plugins?

a)
var myIdVar = 'id1';
var myClassVar = 'class1';
$('<div></div>').attr({'id':myIdVar,'class':myClassVar}).appendTo('#myAnchor
');

or 

b)
var myIdVar = 'id1';
var myClassVar = 'class1';
var myHtml = '<div ';
myHtml += 'id="'+myIdVar+'" class="'+myClassVar+'"></div>';
$('#myAnchor').append(myHtml);

regards steff


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to