title: getting this error in ie11: Unable to get property 'options' of undefined or null reference
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function run(event) {
  console.log(document.getElementById("user").label);
  var lable=event.target.options[event.target.selectedIndex].parentNode.label;
      if(lable == 'user'){
        document.getElementById("copy").value = "user";
      } else if (lable == 'warehouse') {
       document.getElementById("copy").value = "warehouse";
      } else if (lable == 'dollhouse') {
       document.getElementById("copy").value = "dollhouse";
      }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form&gt;
  &lt;select name="sel" id="sel" onchange="run(event)"&gt;
  &lt;option selected disabled&gt;Wybierz...&lt;/option&gt;
    &lt;optgroup id="user" value="user" label="user"&gt;
      &lt;option value="1"&gt;michal&lt;/option&gt;
      &lt;option value="2"&gt;mateusz&lt;/option&gt;
    &lt;/optgroup&gt;
    &lt;optgroup id="warehouse" value="warehouse" label="warehouse"&gt;
      &lt;option value="1"&gt;kosz&lt;/option&gt;
      &lt;option value="2"&gt;zaginione&lt;/option&gt;
    &lt;/optgroup&gt;
    &lt;optgroup id="dollhouse" value="dollhouse" label="dollhouse"&gt;
      &lt;option value="1"&gt;muiy&lt;/option&gt;
      &lt;option value="2"&gt;goey&lt;/option&gt;
    &lt;/optgroup&gt;
  &lt;/select&gt;
  &lt;/form&gt;
  &lt;input type="text" name="copy" id="copy"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Need helping getting this to work in IE11, works fine in chrome. Getting 'Unable to get property 'options' of undefined or null reference'</p>