jquery vanilla val (v14)

Revision 14 of this benchmark created on


Preparation HTML

<input id='jq'>
<input id='no-jq'>
<input id='no-jq-2'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
$('#jq').click();
ready
No jQuery
$('#no-jq').click();
ready
no jquery 2
$('#no-jq-2').click();
ready

Revisions

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