Detecting HTML5 data attribute in Modernizr
How do I detect if the browser supports HTML5 data
attribute开发者_开发知识库 using Modernizr?
Test whether an element has the property dataset
.
Modernizr.addTest('data', function () {
var elem = document.createElement('div');
return !!elem.dataset;
});
精彩评论