jquery ui plugin for cross browser placeholders

mainly trying to get the same experience in chrome where on focus the text still shows until new input is detected

by bizamajig

HTML

<input type='text' placeholder='this is a test' />
<input type='password' placeholder='testing password' />

CSS

input.placeholder { 
            color:#999;
            font-style: italic;
        }
        ::-webkit-input-placeholder    { 
            color:#999;
            font-style: italic;
        }
        input:-moz-placeholder { 
            color:#999;
            font-style: italic;
        }

JavaScript

$(function() {
function init() {
    $('[placeholder]').placeholder();
}

/*
* Placeholder plugin for jQuery
* ---
* Copyright 2010, Daniel Stocks (http://webcloud.se)
* Released under the MIT, BSD, and GPL Licenses.
*/
(function($) {
    function Placeholder(input) {
        this.input = input;
        if (input.attr('type') == 'password') {
            this.handlePassword();
        }
        // Prevent placeholder values from submitting
        $(input[0].form).submit(function() {
            if (input.hasClass('placeholder') && input[0].value == input.attr('placeholder')) {
                input[0].value = '';
            }
        });
    }
    Placeholder.prototype = {
        show : function(loading ) {
            // FF and IE saves values when you refresh the page. If the user refreshes the page with
            // the placeholders showing they will be the default values and the input fields won't be empty.
            if (this.input[0].value === '' || (loading && this.valueIsPlaceholder())) {
                if (this.isPassword ) {
                    try {
                        this.input[0].setAttribute('type', 'text');
                    } catch (e) {
                        this.input.before(this.fakePassword.show()).hide();
                    }
                }
                this.input.addClass('placeholder');
                this.input[0].value = this.input.attr('placeholder');

                this.moveCursorToBeginning();
            }
        },
        hide : function( override ) {
            if (this.valueIsPlaceholder( override ) && this.input.hasClass('placeholder')) {
                this.input.removeClass('placeholder');
                if( !override ) {
                    this.input[0].value = '';
                }

                if (this.isPassword ) {
                    try {
                        this.input[0].setAttribute('type', 'password');
                    } catch (e) { }
                    // Restore focus for...