I have a text and a password input field that I'm trying to select in this fashion:
input[type=text][type=password]
however this does not work. I would refrain from using jQuery, so any help would be appreciated (without using custom classes).
Element Selectors The selector "input[type=text]" means select all inputs with the type attribute equal to text.
When you group CSS selectors, you apply the same styles to several different elements without repeating the styles in your stylesheet. Instead of having two, three, or more CSS rules that do the same thing (set the color of something to red, for example), you use a single CSS rule that accomplishes the same thing.
When present, it specifies that the user is allowed to enter more than one value in the <input> element. Note: The multiple attribute works with the following input types: email, and file. Tip: For <input type="file"> : To select multiple files, hold down the CTRL or SHIFT key while selecting.
You need to specify the attributes separately, repeating the types if necessary and using comma(s):
input[type=text], input[type=password]
Your given selector is trying to match an input
with a type
that is both text
and password
, but a single element can't have different values for the same attribute so it fails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With