Test case details

Preparation Code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <div id="el" class="class"></div> <script>   var i = 0,       el = document.getElementById('el'),       $elId = $('#el'),       $elClass = $('.class'); </script>

Test cases

Test #1

$.data(el, 'key-' + Math.floor(Math.random() * 1001), 'val-' + Math.floor(Math.random() * 1001));

Test #2

$elClass.data('key-' + Math.floor(Math.random() * 1001), 'val-' + Math.floor(Math.random() * 1001));

Test #3

$.data($elClass, 'key-' + Math.floor(Math.random() * 1001), 'val-' + Math.floor(Math.random() * 1001));

Test #4

$elId.data('key-' + Math.floor(Math.random() * 1001), 'val-' + Math.floor(Math.random() * 1001));

Test #5

$.data($elId, 'key-' + Math.floor(Math.random() * 1001), 'val-' + Math.floor(Math.random() * 1001));