Showing jQuery UI tooltip on focus of text box
The demo is seen here

$('.tooltip').each(function () {

    //title can be fetched directly from the element. I know no bugs for to
    //require the use of `attr()`. This removes several function calls.

    //No need to get the element by id since the current elements you are iterating
    //over each are the same DOM elements you are trying to attach events to. The
    //`this` in here is where you attach events.

    //You are appending the content to the parent, landing the span next to input.
    //Instead of doing that, you can use `insertAfter()` which inserts the object in
    //context after  the specified element, which is the current object in the
    //`each()`. It also accepts a DOM element so no need to wrap it in jQuery.

    var t = $('&lt;span /&gt;', {
        title: this.title
    }).insertAfter(this).tooltip({
        position: {
            of: '#' + this.id,
            my: "left+190 center",
            at: "left center",
            collision: "fit"
        }
    });

    this.title = '';

    //Now the only need to wrap the current object this is here, when we attach events. 

    //Since the event methods are merely shorthands of `on(eventName,fn)`, we use 
    //`on()` instead to lessen function calls. Also, it allows a map of events, which
    //results in calling `on()` only once.

    $(this).on({
        focusin: function () {
            t.tooltip('open');
        },
        focusout: function () {
            t.tooltip('close');
        }
    });
});