From: John Resig Date: Fri, 29 Jun 2007 21:03:27 +0000 (+0000) Subject: Added fix for broken :only-child. X-Git-Tag: 1.1.3~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7b9d8258909a626f3f380c763ed81150570bbad5;p=jquery.git Added fix for broken :only-child. --- diff --git a/src/selector/selector.js b/src/selector/selector.js index 13fd09428..e6d2d0697 100644 --- a/src/selector/selector.js +++ b/src/selector/selector.js @@ -16,7 +16,7 @@ jQuery.extend({ // Child Checks "first-child": "a.parentNode.getElementsByTagName('*')[0]==a", "last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a", - "only-child": "a.parentNode.getElementsByTagName('*').length==1", + "only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')", // Parent Checks parent: "a.firstChild",