Get Value vs Text vs innerHTML (v3)

Revision 3 of this benchmark created on


Description

Setting new text to input or textnode

Preparation HTML

<div id="text">1</div>
<input id="inpt" type="text" name="input" value="1">

Test runner

Ready to run.

Testing in
TestOps/sec
innerHTML
var i = 0,
    il = 150;


for (; i < il; i += 1) {

 var newTest = document.getElementById("text").innerHtml;


}
ready
value
var i = 0,
    il = 150;


for (; i < il; i += 1) {
 var newTest = document.getElementById("inpt").value;

}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.