title: IE 11: Object doesn't support property or method 'getElementsByClassName'
body: <p>This is not a duplicate. Previous questions relate to IE8. This is occurring in IE11.</p>
  
  <p>I have no problems running this in Chrome or Firefox, but my code must function in IE11 and I am receiving the following error:</p>
  
  <p>Object doesn't support property or method 'getElementsByClassName'</p>
  
  <pre><code>function showNext(a) {
      var questions = document.getElementsByClassName("questionholder");
      showRequired.style.display = "none";
  
      for (var i = 0; i &lt; questions.length; i++) {
          questions[i].style.display = "none";
      }
  
      var nextQuestion = document.getElementById("question" + a);
  
      if (nextQuestion !== null) {
          nextQuestion.style.display = "inline-block";
      }
  }
  </code></pre>
  
  <p>The code is supposed to be looking here:</p>
  
  <pre><code>&lt;form id="TheForm" style="display:block;"&gt;
      &lt;div class="questionholder" id="question0" style="display:block"&gt;
          &lt;a class="text2button" onclick="showNext(1)"&gt;Start&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="questionholder" id="question1" style="display:block"&gt;
          &lt;a class="text2button" onclick="showNext(2)"&gt;Q1&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="questionholder" id="question2" style="display:block"&gt;
          &lt;a class="text2button" onclick="showNext(3)"&gt;Q2&lt;/a&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The code above will hide all divs and then show the div that matches the id "question"+a as determined by the button clicked.</p>
  
  <p>What can I do to resolve the above error?</p>