diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index f03a66927..bc1109918 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -401,7 +401,7 @@ $.widget( "ui.selectmenu", { this._super( key, value ); if ( key === "appendTo" ) { - this.menuWrap.appendTo( $( value || "body", this.element[ 0 ].ownerDocument )[ 0 ] ); + this.menuWrap.appendTo( this.document.find( value || "body" )[0] ); } if ( key === "disabled" ) { this.menu.menu( "option", "disabled", value );