title: Change background image of CSS class in javascript
body: <p>I have this javascript code to increase and decrease the height of div. Function calls on <code>onclick</code> event div text changes to 'click to minimize' and if clicked again,it changes to 'click to read'.
  I want to change background-image instead of text in <code>button</code> class.</p>
  
  <pre><code>function chk()
  {
      var node = document.getElementById('content');
  
      node.classList.toggle('expand');
      document.getElementByClass('button').style.backgroundImage = node.classList.contains('expand')? 'click to minimize':'click to read';
  }
  </code></pre>
  
  <p>this is the css</p>
  
  <pre><code>.content
  {
      height:auto;
  }
  
  .content.expand
  {
      height:150px;
  }
  </code></pre>