title: Learning Vanilla JavaScript, for loop
body: <p>I am trying to learn Vanilla JavaScript or pure JS however you look at it. I started off learning jQuery and now I am trying to better my speeds with no framework. I usually can get this with just jQuery but am having a hard time doing this with pure JS.</p>
  
  <pre><code>var a = $('.entry-content'),i;
  
  for (i=0;i&lt;a.length; i++) {
     var b = a[i].innerHTML;
     var c = document.createElement('div');
     var d = c.id = 'reply_bb';
     var e = d.innerHTML = 'Reply';
     a[i].innerHTML = a[i].appendChild(c);
   }
  </code></pre>
  
  <p>Basically what I would like to do is add an element to the var a element. </p>
  
  <pre><code>   &lt;div class="entry-content"&gt;
       &lt;div&gt;
           Words from a poster or whatever would be in side here
       &lt;/div&gt;
     &lt;/div&gt;
  </code></pre>
  
  <p>After javascript =</p>
  
  <pre><code>   &lt;div class="entry-content"&gt;
       &lt;div&gt;
           Words from a poster or whatever would be in side here
       &lt;/div&gt;
        &lt;div id="reply_bb"&gt;Reply&lt;/div&gt;
     &lt;/div&gt;
  </code></pre>
  
  <p>Also since this is related. When creating an element dynamically would I use <code>.click</code> or <code>.on('click',function() {</code> or how would I go about that? I want it so when the user clicks reply_bb it appends another Element that is already on the page just hidden. </p>