Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

check if input is empty css

/* If input is not empty */
input:not(:placeholder-shown) {
  /* You need to add a placeholder to your fields. For example: <input "placeholder=" "/> */
  border-color: green;
}

/* If input is empty */
input:placeholder-shown {
  border-color: red;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #input #empty #css
ADD COMMENT
Topic
Name
4+5 =