title: referring to a style property using a variable
body: <p>In the project I am working on, I have to access the style property of an element using a variable. 
     For example: Normally, to change the background color of an element we write:</p>
  
  <pre><code>var element = document.getElementById("element");
  element.style.backgroundColor = "blue";
  </code></pre>
  
  <p>But, If I declare a variable holding "backgroundColor" and then I want to change the property of background color by referring to the value in this this variable, then how could it be done. 
      I tried these:</p>
  
  <pre><code>var property = "backgroundColor";
  eval(element.style.property = "blue");
  </code></pre>
  
  <p>But it didn't work. I am not sure of any other way I can accomplish this. If there is any solution for this, then please answer.</p>