jquery select & val vs dom getelementbyid & value

Benchmark created on


Preparation HTML

<input type="text" name="test" id="test" value="this is a test"/>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
jquery select & val
var value = $('#test').val();
ready
dom getelementbyid & value
var value = document.getElementById('test').value;
ready

Revisions

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