views:

61

answers:

3

Which is better to select textbox:

input[type=text] or input:text

Which to use?

+3  A: 

The shortest:

$('input:text')
meder
+2  A: 

Remember you can also do

$(':text')

Although this is not recommended by the manual.

Vegard Larsen
Only time you'd want to do this is if you were filtering something that was already made up of all inputs.
TM
A: 

Please note that Internet Explorer does not support

input[type=text]

CSS selector, but it will work on JQuery. The simplest, is, of course

:text
Lastnico