Cannot change jquery-ui tooltip content as it is being displayed

Cannot change jquery-ui tooltip content as it is being displayed

I am using jquery-validation alongside jquery-ui tooltip to do the validation and displaying of errors in my form.


To do that, I set the errorPlacement option of jquery-validation as such


    errorPlacement : function(error, element) {

      element[0].title = errorMessage;

    }


This sets the title of my element with the error message, and jquery-ui does the job of displaying it as a tooltip. Then, when the error is corrected, I simply clear the title of the error, in hopes of stopping the tooltip from being displayed:


    unhighlight: function(element, errorClass, validClass) {

        element.title = "";

    }


This works fine under certains circumstances, but not others. The problem is, when the tooltip is being shown, for some reason, the title of the element is erased (and I assume, stored elsewhere in memory), and when the tooltip is hidden, the title is re-added. So if unhighlight is triggered as the tooltip is shown, there is no title to clear, and then the title comes back as you take your mouse pointer away from the element. This means that if I correct the error in my element as the tooltip is being displayed, my validation fails to remove the message.


What causes this? Is there a way to also erase the title that, I assume, is being stored in memory somewhere by jquery-ui?