SyntaxFix
Write A Post
Hire A Developer
Questions
The valid selector will do the trick.
<input type="text" class="myText" required="required" /> .myText { //default style of input } .myText:valid { //style when input has text }