How to change div title using jquery

You can change the title of a dialog directly with:

$('#DivPassword').dialog('option', 'title', 'Photo by Kelly Clark');

This will work in your case. In fact, your code to change the title attribute is correct. I guess that the dialog plugin creates the dialog when .dialog is called first. The open method just displays the dialog then, without re-creating it from the div.


You can change ANY attribute from any DOM element with jQuery as easy as:

$("#divMessage").attr('title', 'Type here the new Title text');

Cheers!

Tags:

Jquery