title: Change div color using multiple radio buttons and JavaScript
body: <p>I'm trying to use radio buttons to change the background color of my div tag. I would like to use more than more condition. E.g., if button A is clicked and button B is clicked then make the color green.
  This is what I have so far.</p>
  
  <pre><code>&lt;div id="CLWarn"&gt;Warning Colour &lt;/div&gt;
  &lt;input type="radio" name="IM" id="IM" value="1" onclick="A(this)"/&gt;
  &lt;input type="radio" name="PB" id="PB" value="1" onclick="B(this)"/&gt;
  
  function A(chk) {
  if(chk.checked == true) {
  function B(chk) {
  if(chk.checked == true) {   
  $(document).ready(function(){
  document.getElementById("CLWarn").style.backgroundColor="Green";
  document.getElementById("CLWarn").style.lineHeight=1.8;})
  }}
  }}
  </code></pre>
  
  <p>It works if I'm only using one condition (just clicking one button and only having the one function, but I don't know how to add another condition to my function.</p>