aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/jquery.ui.button.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index 56e0d2d22..bddedead6 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -200,7 +200,7 @@ $.widget( "ui.button", {
if ( this.type === "checkbox" || this.type === "radio" ) {
// we don't search against the document in case the element
// is disconnected from the DOM
- var ancestor = this.element.parents().last(),
+ var ancestor = this.element.parents().filter(":last"),
labelSelector = "label[for=" + this.element.attr("id") + "]";
this.buttonElement = ancestor.find( labelSelector );
if ( !this.buttonElement.length ) {