title: Style background image with JS not working
body: <p>Ok, maybe its a stupid question with a little bug, but I'm trying fix this and I can not:</p>
  
  <pre><code>    &lt;style&gt;
   .pagar a {   
   width:  200px;
   height: 85px;
   display: block; 
   background-image: url('imagens/pagar.jpg'); 
   background-repeat: no-repeat;
  
       } 
  .pagar a:hover { 
   background-image: url('imagens/pagar-hover.jpg');
   background-repeat: no-repeat; } 
  &lt;/style&gt;
  
      &lt;script&gt;
      function clickado() {
      document.getElementsByClassName('pagar')[0].style.backgroundImage = 'url("imagens/pagar-clickado.jpg")';
      }
      &lt;/script&gt;
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="pagar" id="pagar" &gt;&lt;a href="#" onclick="clickado()"&gt;&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>The problem:</p>
  
  <p>The .style.backgroundImage just does not change to "imagens/pagar-clickado.jpg", the the path is correct, I do not get error in console and ('pagar')[0] is also correct too. </p>