Posted By

iroybot on 02/22/09


speed performance benchmark chili

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


Performance issues when modifying HTML with jQuery

 / Published in: JavaScript


I just found this interesting comment in the jQuery Syntax Hiliting Plugin "Chili". It seems, one should preferrably use innerHTML instead the core jQuery method... (Just to clarify: I didn't do any benchmarking myself)

  1. el.innerHTML = dish; //much faster than $el.html( dish );
  2. //tried also the function replaceHtml from
  3. //but it was not faster nor without sideffects (it was not possible to count spans into el)

Report this snippet  

You need to login to post a comment.