Test case details

Preparation Code

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script> <p id="foo">   Test </p> <p id="bar">   bars</p>

Test cases

Test #1

$(document.getElementById('foo'));

Test #2

$('#foo');

Test #3

function _(id){     return jQuery(document.getElementById(id)); } _('foo');  

Test #4

function getObject(id){     return $(document.getElementById(id)); } getObject('foo');

Test #5

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

Test #6

document.getElementById('foo');

Test #7

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