简体   繁体   中英

Retrieve jquery-ui dialog's div

When we apply $().dialog() in an object, jquery-ui puts it inside a <div class="ui-dialog ui-widget"> , with a <div class="ui-dialog-titlebar ui-widget-header"> before it.

After the creation of this dialog around the main object, how can we get that ui-dialog object so that we can execute other JavaScript commands in it?

The best I could do was use .parent(".ui-dialog") in the main object, is there a better way to do it?

I think you might be looking for this:

var widget = $( "#yourdialogsource" ).dialog( "widget" );

This will get you the jQuery object of the wrapper for your dialog.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM