title: Adding/changing attributes of HTML elements in IE9
body: <p>Having issues with M$ and IE9, changing or adding attributes to HTML elements in my DOM. I have seen that this browser requires different syntax but not sure what to write I have tried the following approaches </p>
  
  <pre><code>var element = document.getElementById("object");
  var element2 = document.getElementsByTagName("object")[0];
  
  element.style = "something";
  element.setAttribute("style","something");
  
  element2.style = "something";
  element2.setAttribute("style","something");
  </code></pre>
  
  <p>I have tried mixing and matching but I always get the following "Unable to get value of the property (whatever follows the "."): object is null or undefined" </p>
  
  <p>In the html the element is just a div like </p>
  
  <pre><code>&lt;div id="object"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>any ideas?</p>