X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2FcoreTest.js;h=a7b470e09b354ff7aba14a5ec94fcda82f8e6fb9;hb=d9464547e0c328bf9f9b67e8d38621023a7e450e;hp=a9c3e26d1d5b32002a2a91d0811e50cfa4c759f1;hpb=5cfaef9ff9b121850f1e27afae6819023acadbf7;p=jquery.git diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index a9c3e26..a7b470e 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -663,3 +663,13 @@ test("eq(), gt(), lt(), contains()", function() { isSet( $("#ap a").lt(3).get(), q("google", "groups", "anchor1"), "lt()" ); isSet( $("#foo a").contains("log").get(), q("anchor2", "simon"), "contains()" ); }); + +test("click() context", function() { + $('
  • Change location
  • ').prependTo('#firstUL').find('a').bind('click', function() { + var close = $('spanx', this); // same with $(this).find('span'); + ok( close.length == 0, "Element does not exist, length must be zero" ); + ok( !close[0], "Element does not exist, direct access to element must return undefined" ); + //console.log( close[0]); // it's the and not a element + return false; + }).click(); +}); \ No newline at end of file