title: I wrote javascript with ES6, but It's not working in IE. How could I change old version of javascript
body: <p>I wrote javascript with ES6, but It's not working in IE. Especially IE9. How could I change old version of javascript. I tried translate from ES6 to old version, but I couldn't. Because I learned ES6 first.</p>
  <pre><code>const btns = document.querySelectorAll(&quot;.btn&quot;);
    Array.from(btns).forEach(item =&gt; {
      item.addEventListener(&quot;click&quot;, () =&gt; {
        const selected = document.querySelectorAll(&quot;.btn.active&quot;);
        selected[0].className = selected[0].className.replace(&quot; active&quot;, &quot;&quot;);
        item.className += &quot; active&quot;;
    });
  });
  
  const setActive = el =&gt; {
      [...el.parentElement.children].forEach(sib =&gt; sib.classList.remove(&quot;active&quot;))
      el.classList.add(&quot;active&quot;)
    }
  
  const setPlace = el =&gt; {
    const hasClass = el.classList.contains(&quot;active&quot;);
    const parent = el.parentElement.parentElement;
    if (!hasClass) {
        el.classList.add(&quot;active&quot;);
        parent.classList.add(&quot;active&quot;);
    } else {
        el.classList.remove(&quot;active&quot;);
        parent.classList.remove(&quot;active&quot;);
    }
  }
  
  const spans = [...document.body.querySelectorAll(&quot;.choose .table_mid ul &gt; li&quot;)]
  const place = [...document.body.querySelectorAll(&quot;.search_contents .place&quot;)]
  spans.forEach(el =&gt; el.addEventListener(&quot;click&quot;, e =&gt; setActive(el)))
  place.forEach(el =&gt; el.addEventListener(&quot;click&quot;, e =&gt; setPlace(el)))
  </code></pre>