title: CSS or JS - change background color of input when input is focused out?
body: <p>Is there any way to set a <code>background-color</code> on input text when it looses focus?</p>
  
  <p>I'm trying in js but i would like to know if it's possible in css pure.</p>
  
  <p>this seems not working</p>
  
  <pre><code>input{
   background-color:#fff !important;
  }   
  input:focus{
  background-color:#333 !important;
  }
  //input:unfocused and has value{ ??? :) }
  
   $('input,textarea').on('focusout',function(e){
        if($(this).val().length){
         $(this).css('background-color','#fff');
        }
        });
  </code></pre>
  
  <p>thank you</p>