jquery vanilla val (v8)

Revision 8 of this benchmark created by Robert on


Preparation HTML

<input id='jq'>
<input id='nojq'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var $jq = $('#jq'),
        $nojq = $('#no-jq');
    
    $jq.click(function() {
      var val = $jq.val();
    });
    
    $nojq.click(function() {
      var val = this.value;
    });

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
$jq.click();
ready
No jQuery
$nojq.click();
ready

Revisions

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