Check if html element is supported
问题 How to check if html element is supported, datalist for example? MDC says it is supoorted only in Opera and FireFox. 回答1: if ('options' in document.createElement('datalist')) { // supported! } http://diveintohtml5.info/everything.html#datalist 回答2: If someone needs to check for support of other HTML5 elements this could also be used. https://github.com/ryanmorr/is-element-supported From http://ryanmorr.com/determine-html5-element-support-in-javascript/ /* * isElementSupported * Feature test