jQuery ui dialog change title after load-callback

Guido Lemmens 2 picture Guido Lemmens 2 · Jan 31, 2010 · Viewed 130.2k times · Source

I like to change the title from an UI Dialog after i have submitted a form in this UI Dialog. So in the callback-function after load i should suggest, but i've tried and googled without result.

Has anyone an idea?

Answer

Nick Craver picture Nick Craver · Jan 31, 2010

Using dialog methods:

$('.selectorUsedToCreateTheDialog').dialog('option', 'title', 'My New title');

Or directly, hacky though:

$("span.ui-dialog-title").text('My New Title'); 

For future reference, you can skip google with jQuery. The jQuery API will answer your questions most of the time. In this case, the Dialog API page. For the main library: http://api.jquery.com