getElementById vs. jQuery val() (v2)

Revision 2 of this benchmark created on


Preparation HTML

<label for="action">
  Action:
</label>
<input type="text" id="action" name="action" value="brol" />
<label for="hour">
  Heure:
</label>
<input type="text" id="hour" name="hour" value="brol" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById
var action = document.getElementById('action').value;
ready
jQuery
var action = $('#action').val();
ready

Revisions

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