{"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));\r\nvar $body = $(document.body)","TestCases":[{"Name":"is() or contains()","Code":"var found = $body.is($innerOne) || $.contains($body[0],$innerOne[0]);","IsDeferred":false},{"Name":"== or contains()","Code":"var body = $body[0]; \r\nvar innerOne = $innerOne[0]; \r\nvar found = body==innerOne || $.contains(body,innerOne);","IsDeferred":false},{"Name":"!!closest.length","Code":"var found = !!$innerOne.closest($body).length;","IsDeferred":false},{"Name":"== and parentNodes","Code":"var found = false;\r\nvar container = $body[0];\r\nvar contained = $innerOne[0];\r\nif(contained===container){\r\n found=true;\r\n} else if(container \u0026\u0026 contained){\r\n var pointer = contained;\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}]}