Roar Roar - 1 month ago 7
Javascript Question

HTML5 jQuery select all date fields 'input:date'

Is there a way to select all date inputs?
I have:

<input type="date" name="bday">


all i need it's just to select all inputs.

there are many selectors, but nothing like:

$('input:date')


this approach

$("input[type='date']")


looks no good

What's the best practice?

Answer

If you want something cross browser, you should stick with:

$('input[type="date"]')

I don't think you can select all inputs of type date in a different way. If however you want to select all text fields you can go with

$(':text') 

or if you want all radios you can go with

$(':radio')
Comments