javascript that falls back to select when range is not supported