css3 - Apply style to all input text not empty via CSS -


can done via css3 ?

var inputs = document.getelementsbytagname("input"); (var = 0; < inputs.length; i++) {     if (inputs[i].type == "text")     {         if (inputs[i].value != "")         {             inputs[i].style.borderbottomcolor = '#448aff';         }     } }  var textareas = document.getelementsbytagname("textarea"); (var = 0; < textareas.length; i++) {     if (textareas[i].value != "")     {         textareas[i].style.borderbottomcolor = '#448aff';     } }     

i don't mind not supporting ie10.

textarea:valid, input:valid {     border-bottom-color: #448aff; } 

also need add pattern=".*?\s.*" (only valid @ least 1 non-space character) , required attributes thos pseudo-classes. want customise :invalid state, too.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -