Fred J. Fred J. - 1 year ago 84
Javascript Question

jQuery selector of optional types

This jQuery selector tries to match

elements which have any of the following types
[text | number | email | tel]

It is failing to match the elements. how can it be done? Thx


Answer Source

You need to have a comma separated selector:

$('input[type="text"], input[type="number"], input[type="email"], input[type="tel"]')

Another option is:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download