I here have 3 <input>s in my HTML:
Name: <input><br>
Age: <input type="number"><br>
Site: <input type="url">
And I can select the bottom two with these CSS:
input[type="number"]{
color: gray;
}
input[type="url"]{
color: blue;
}
But I don’t know how to select the first one that has no type.
I tried:
input{
color: red;
}
But it will change the other two as well.
input[type=""]{
color: red;
}
This is still not working.
Any idea?
The selector
input[type=""]will look for an input that has the attributetypewhich is set to empty. Try using this:See the jsFiddle.