modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
15 lines (14 loc) • 423 B
JavaScript
/*!
{
"name": "placeholder attribute",
"property": "placeholder",
"tags": ["forms", "attribute"],
"builderAliases": ["forms_placeholder"]
}
!*/
/* DOC
Tests for placeholder attribute in inputs and textareas
*/
define(['Modernizr', 'createElement'], function(Modernizr, createElement) {
Modernizr.addTest('placeholder', ('placeholder' in createElement('input') && 'placeholder' in createElement('textarea')));
});