HTML5 tests - checking input types with JS

Spec

It is possible in most browsers to use JavaScript to detect support for specific input types. This page studies various solutions.

I perform two tests on each input:

  1. The type test. A browser passes if the input’s type is NOT text.
  2. The value test. I set the input’s value to 'Hello World', and a browser passes if this value is rejected (i.e. if, when I read out input.value I do NOT get 'Hello World')

color

email

number

range

url

date

datetime

month

time

week