{"ScriptPreparationCode":"//Add 100,000 elements\r\nvar frag = document.createDocumentFragment();\r\nfor (var i=0; i\u003C10; i\u002B\u002B){\r\n var outDiv = document.createElement(\u0027div\u0027);\r\n for (var j=0; j\u003C100; j\u002B\u002B){\r\n var midDiv = document.createElement(\u0027div\u0027);\r\n for (var k=0; k\u003C100; k\u002B\u002B){\r\n var inDiv = document.createElement(\u0027div\u0027);\r\n if(i==6 \u0026\u0026 j==60){\r\n if(k==60)\r\n inDiv.id=\u0022one\u0022;\r\n else if(k==61)\r\n inDiv.id=\u0022two\u0022;\r\n }\r\n midDiv.appendChild(inDiv)\r\n }\r\n outDiv.appendChild(midDiv)\r\n }\r\n frag.appendChild(outDiv);\r\n}\r\ndocument.body.appendChild(frag);\r\nvar innerOne = document.getElementById(\u0027one\u0027);","TestCases":[{"Name":"is() or contains()","Code":"var found = $(document.body).is(innerOne) || $.contains(document.body,innerOne);","IsDeferred":false},{"Name":"== or contains()","Code":"var found = document.body==innerOne || $.contains(document.body,innerOne);","IsDeferred":false},{"Name":"!!closest.length","Code":"var found = !!$(innerOne).closest(document.body).length;","IsDeferred":false},{"Name":"== and parentNodes","Code":"var found = false;\r\nvar container = document.body;\r\nif(innerOne===document.body){\r\n found=true \r\n} else{\r\n var pointer = innerOne;\r\n var parent = pointer.parentNode;\r\n \r\n while(parent \u0026\u0026 pointer!==container){\r\n\tif(parent === container){\r\n\t\tfound=true;\r\n \tbreak;\r\n }\r\n pointer = parent;\r\n parent = pointer.parentNode;\r\n }\r\n \r\n}","IsDeferred":false}]}