SO - 20537196

by Arun P Johny

HTML

<div class="6u">
    <label>Email</label>
    <input type="email" class="text" name="email" placeholder="Email" />
</div>

CSS

.placeholder label{
    display: none;
}

JavaScript

(function () {
    var el = document.createElement('input');
    if (el.hasOwnProperty('placeholder')) {
        var html = document.getElementsByTagName("html")[0];
        html.className = (html.className || '') + ' placeholder'
    }
})();