This is how you check if you can use the browser's implementation of new HTML5 input types (just like Modernizr & co.)

function testInputSupport(type) {
    var i = document.createElement('input');
    i.setAttribute('type', type);
    return i.type !== 'text';
}