':text' is case-sensitive on type whereas '[type=text]' is case-insensitive
|Reported by:||david@…||Owned by:|
Documentation for :text selector says $(':text') is equivalent to $('[type=text]') however I have verified that it is not.
Assume want to match <input type="TEXT"> -- N.B.: uppercase TEXT.
'input:text' is case sensitive on type and thus does not match.
'input[type=text]' is case insensitive and thus does match.
The bug is that the :text filter calls elem.getAttribute( "type" ) which returns "TEXT" in this case, whereas elem.type returns "text" in this case.
In the definition of the :text filter function, replace:
var attr = elem.getAttribute( "type" ), type = elem.type;
var attr = elem.getAttribute( "type" ).toLowerCase(), type = elem.type;
Change History (4)
comment:1 follow-up: ↓ 2 Changed 6 years ago by addyosmani
- Component changed from unfiled to selector
- Keywords needsreview added
- Priority changed from undecided to low