modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
16 lines (13 loc) • 384 B
JavaScript
/*!
{
"name": "placeholder attribute",
"property": "placeholder",
"tags": ["forms", "attribute"]
}
!*/
/* 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')));
});