JSFiddle - React, Tailwind, and code Playground

by rodneyrehm

JavaScript

// detecting <input type> support
// Use Modernizr.inputtypes instead!

var input = {},
    el = document.createElement('input'),
    key = "search tel url email datetime date month week time datetime-local number range color".split(" ");

for (var i=0, k; k = key[i]; i++) {
  el.setAttribute('type', k);
  input[k] = el.type == k;
}

console.dir(input);