jQuery objects

Benchmark created on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<div>
	<p id="status-message">This sucks</p>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Without variable
console.log($('#status-message').text())

$('#status-message').css({ color: 'red' })

$('#status-message').text('Yay')
ready
With variable
const sm = $('#status-message');
console.log(sm.text())

sm.css({ color: 'red' })

sm.text('Yay')
ready

Revisions

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