JS Selector

Benchmark created on


Preparation HTML

<div class="container">
	<div class="some-inner-container">
		<div id="selection">
			<header>Here</header>
		</div>
	</div>
</div>

<script
  src="https://code.jquery.com/jquery-2.2.4.min.js"
  integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
  crossorigin="anonymous"></script>

Setup

const $container = $('.container');

Test runner

Ready to run.

Testing in
TestOps/sec
Find in container
const $target = $container.find('#selection header');
$target.after('<p>inject</p>');
ready
Select Target
const $target = $('#selection header');
$target.after('<p>inject</p>');
ready

Revisions

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