selectors, bitch

Benchmark created by ben on


Preparation HTML

<script src="//cdn.ext/library.js"></script>
<form id="fuckDerek">
<input name="gift_certificate[recipient_name]" id="gift_certificate_recipient_name" />
</form><script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var $form;
    $form = $('#fuckDerek');

Test runner

Ready to run.

Testing in
TestOps/sec
tag/name query
$form.find("input[name='gift_certificate[recipient_name]']").val();
ready
id
field = $form.find("#gift_certificate_recipient_name").val();
ready
dom
field = $form.get(0)['gift_certificate[recipient_name]'].value
ready

Revisions

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