Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
uitgewis
· 9y ago · 0 comments
You could potentially use the validation rules, and set a min length of 1.
Comments
[–]
KwanEsq
9y ago
You'd need [required] instead of [minlength] for :valid to work. The other option is :placeholder-shown, to style no-input normally, but it's newer and not as supported.
[–]
vilmosi
9y ago
I wonder if the good old input[value=""] would work. Probably not if you have jQuery.
[–]
bzbarsky
9y ago
No, because that matches on the HTML attribute (aka the defaultValue property in JS), not on the current value of the input.