Test case details

Preparation Code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <input type="text" id="theInput" value="foo"></input> <script>   var theInput = $('#theInput');   theInput.attr('someAttr', 'theValue').data('someData', 'theValue'); </script>

Test cases

Test #1

theInput.attr('someAttr');

Test #2

theInput.attr('someAttr', 'newValue');

Test #3

theInput.data('someData');

Test #4

theInput.data('someData', 'newValue');

Test #5

$.data(theInput, 'someData');

Test #6

$.data(theInput, 'someData', 'newValue');