title: Using js verification to change background-image
body: <p>i'm with a little problem. I was building a form in HTML with javascript, but in the inputs, i've used a background-image and a padding in left to make it look better, here its all ok, the problem comes next. I've created this function here:</p>
  
  <pre><code>function verificar_email(email) {
  var valor = email.value;
  
  if (valor.length != 0){
      if (valor.indexOf('@') &gt;= 1) {
          if (valor.indexOf('.') &gt; (valor.indexOf('@') + 1)) {
              if (valor.length &gt; (valor.lastIndexOf('.') + 1)) {
  
                  email.style.background = "#1abc9c";
                  email.style.color = "#fefefe";
                  return true;
  
              }
          }
      }
  }
  email.style.background = "#ff0000";
  email.style.color = "#fefefe";
  return false;
  }
  </code></pre>
  
  <p>When the email input is blank or typed wrong, it's filling my bgimage with bgcolor and making the image dissapear. How can i change my original image to other image i've created without filling with color?</p>
  
  <p>Sorry for my bad english, below i will explain what i'm talking about with some images.</p>
  
  <p><a href="http://imgur.com/a/hkigg" rel="nofollow">http://imgur.com/a/hkigg</a> - the first image is the error, the second is what it looks like and the final image is what i wanna do.</p>