title: how to make javascript function call two divs
body: <p>i am trying to make a colour change when a button is clicked and i managed to do this however i want to change the colour of not just the main content container but more containers how do i do this?</p>
  
  <pre><code>    function changeblackandwhite(objDivID) {
    if(document.getElementById(objDivID).style.color=='black'){
      document.getElementById(objDivID).style.color='white';
      document.getElementById(objDivID).style.backgroundColor='black';
    }
  
    else if(document.getElementById(objDivID).style.color=='white'){
      document.getElementById(objDivID).style.color='black';
      document.getElementById(objDivID).style.backgroundColor = 'white';
    }
  
    else{
      document.getElementById(objDivID).style.color='black';
      document.getElementById(objDivID).style.backgroundColor='white';
    }
  }
  
  &lt;a href="javascript:changeblackandwhite('Maincontainer')"&gt;&lt;img src="images/colour.jpg" title="Change Text/Backgroud Colors"&gt;&lt;/a&gt;
  </code></pre>