.innerHTML vs textContent vs value
JavaScript performance comparison
Preparation code
<div id="innerHTML"></div>
<div id="textContent"></div>
<input type="text" size="30" id="value" />
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
innerHTML |
|
pending… |
textContent |
|
pending… |
value |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
1 comment
Value is the best for older browsers.