JSFiddle - React, Tailwind, and code Playground

HTML

<input id="user" type="text" placeholder="someone@example.com" /><br />
<input type="password" placeholder="Password" />

JavaScript

(function($){
    var placeholderIsSupported = ('placeholder' in document.createElement('input'));
    $.fn.emulatePlaceholder = function(){
        if(!placeholderIsSupported){
            this.each(function(index, element){
                var handle = $(element);
                var placeholder = handle.attr('placeholder');           
                if(handle.val() == ''){
                    handle.val(placeholder);    
                }
                handle.blur(function(e){
                    var handle = $(this);
                    if(handle.val() == ''){
                        handle.val(placeholder);
                    }
                });
                handle.focus(function(e){
                    var handle = $(this);
                    if(handle.val() == placeholder){
                        handle.val('');
                    }
                });
            });
        }
    };
})(jQuery);

$('input').emulatePlaceholder();