jQuery visibility test (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/prototype/1/prototype.js"></script>
<div id='foo'>foo</div>
<div id='bar'>bar</div><script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
  var foo = $('#foo').hide(),
      bar = $('#bar');
  
  $.fn.isVisible = function() {
   return $.expr.filters.visible(this[0]);
  };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
is(':hidden')
!foo.is(':hidden');
!bar.is(':hidden');
ready
isVisible
foo.isVisible();
bar.isVisible();
ready

Revisions

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