首页 > 技术文章 > js记性

jamsbwo 2016-08-29 00:00 原文

1、判断浏览器是否支持某个属性

// 判断浏览器是否支持placeholder属性
function isSupportPlaceholder() {
  var input = document.createElement('input');
  return 'placeholder' in input;
}

 

推荐阅读