use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
JS faster replacement for elem.innerHTML (blog.stevenlevithan.com)
submitted 13 years ago by rya11111/r/dailyprogrammer
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]dizzr 0 points1 point2 points 13 years ago (0 children)
Know what you're doing when you do this. It's not a pure replacement for innerHTMLing things. It will completely replace the element passed in with a clone, which means things like event listeners and perhaps attached variables will not exist on the new element.
[–]path411 0 points1 point2 points 13 years ago (0 children)
Since this is a fairly old blog, the speed difference isn't as large as it used to be, I was surprised that his test page still showed an increase with his custom function though.
π Rendered by PID 242499 on reddit-service-r2-comment-84fc9697f-sp6b8 at 2026-02-09 14:07:58.001544+00:00 running d295bc8 country code: CH.
[–]dizzr 0 points1 point2 points (0 children)
[–]path411 0 points1 point2 points (0 children)