Test case details

Preparation Code

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"> </script> <p id="b1"></p> <p id="b2"></p> <p id="b3"></p> <p id="b4"></p> <p id="b5"></p> <p id="b6"></p> <p id="b7"></p> <p id="b8"></p> <p id="b9"></p> <p id="b10"></p> <p id="b11"></p> <p id="b12"></p> <p id="b13"></p> <p id="b14"></p> <p id="b15"></p> <p id="b16"></p> <p id="b17"></p> <p id="b18"></p> <p id="b19"></p> <p id="b20"></p> <table id="foo"><tr><td>   Test </td></tr></table> <p id="bar">   bars</p> <script> var el = document.getElementById("foo"); </script>

Test cases

Test #1

var a=$(document.getElementById('foo')).rows[0].cells[0];

Test #2

var a=$('#foo').rows[0].cells[0];

Test #3

var a=el.rows[0].cells[0];

Test #4

var a=1;

Test #5

$('#foo'); $('#bar');

Test #6

document.getElementById('foo').rows[0].cells[0];

Test #7

if(typeof (document.getElementById('foo')) === "undefined"){}