Is it faster to construct jQuery objects using method syntax or pure html?

Posted by Evan Carroll on Stack Overflow See other posts from Stack Overflow or by Evan Carroll
Published on 2010-06-10T20:40:20Z Indexed on 2010/06/10 20:42 UTC
Read the original article Hit count: 213

Filed under:
|
|

Using jQuery what provides for faster object construction:

With the HTML code

$('<dd class="foo baz" id="bar"> foobar </dd>')

Or with the pure object/method variant

$('</dd>').addClass('foo').addClass('baz').id('bar').text('foobar')

I'm not sure how the internals work, feel free to supply a high level summary.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about optimization