How can I set the title on an element from an attribute of the element?
<p>I am using the following code:</p>

<pre><code>    $(targetSelector)
        .attr({
            'data-disabled': 'yes',
            'data-title': function() { return this.title },
            'title': ''
        })
        .addClass('disabled')
        .prop('disabled', true);
</code></pre>

<p>This sets the element's title to '' after first having stored it in data-title. </p>

<p>How can I restore the elements title by getting it back from the data-title attribute if the title is currently equal to the empty string? I assume I need to do this in a function like the above but how can I code in a check into the function?</p>
