How can I find out if the browser supports the HTML5 placeholder tag, so I can decide whether to hook my jQuery placeholder plugin or not.
var placeholderSupported = ( 'placeholder' in document.createElement('input') );
The variable placeholderSupported will be true if it is natively supported. Otherwise, it'll be set to false.
placeholderSupported
true
false
2.1m questions
2.1m answers
60 comments
57.0k users