title: Cannot read property 'className' of undefined
body: <p>I have written code for multi window form but there is an error shown in image
  <a href="https://i.stack.imgur.com/U4UnY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U4UnY.png" alt="enter image description here"></a></p>
  
  <p>i am new to JavaScript can you please help me, ask me anything you need besides from this</p>
  
  <pre><code>function fixStepIndicator(n) {
      // This function removes the "active" class of all steps...
      var i, x = document.getElementsByClassName("step");
      for (i = 0; i &lt; x.length; i++) {
          x[i].className = x[i].className.replace(" active", "");
      }
      //... and adds the "active" class to the current step:
      x[n].className += " active";
  }
  </code></pre>