title: Iterate / loop through for a pair of variables that are IDs with conditions in Wordpress
body: <p>I have Wordpress site with a page of posts. For each post, I want to run javascript. I essentially want to insert HTML in the output div, conditionally for each. What am I doing wrong?</p>
  <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>&lt;script&gt;
    var labels = document.querySelectorAll("#uniteLabel"),
    unitOutputs = document.querySelectorAll("#uniteOutput");
  
    for (var i=0, i &lt; labels.length, i++) { 
      if (labels[i].innerHTML == "En travers") {
        unitOutputs[i].innerHTML = "Stère";
      } else if (labels[i].innerHTML == "A l’unité de produit") {
        unitOutputs[i].innerHTML = "Stère";
      } else if (labels[i].innerHTML == "En bloc") {
        unitOutputs[i].innerHTML = "m3";
      }
    }
  &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="post"&gt;
    &lt;div id="uniteLabel"&gt;En travers&lt;/div&gt;
    &lt;div id="uniteOutput"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="post"&gt;
    &lt;div id="uniteLabel"&gt;A l’unité de produit&lt;/div&gt;
    &lt;div id="uniteOutput"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="post"&gt;
    &lt;div id="uniteLabel"&gt;En bloc&lt;/div&gt;
    &lt;div id="uniteOutput"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
    </code></pre>
  </div>
  </div>
  </p>