title: selection range issue in IE9
body: <p>I have the following JavaScript code works in IE6, IE7 and IE8. However, the parentElement() and commonParentElement() are not defined in IE9. Would anyone know how to workaround it?</p>
  
  <pre><code>if (document.selection)
  {
      var sel = document.selection; 
      var rng = sel.createRange();
      if (rng) 
      {
             if ("Control" == sel.type &amp;&amp; typeof rng.commonParentElement != "undefined") 
             {
                  targetElement = rng.commonParentElement(); // undefined in IE9
             }
             else if (typeof rng.parentElement != "undefined")
             {
                  targetElement = rng.parentElement(); // undefined in IE9
             }
      }
  }
  </code></pre>