title: Replace innerHTML with attribute value for each element with class
body: <p>Please consider this HTML:</p>
  
  <pre><code>&lt;a class="title" threedots="Product Name 1"&gt;&lt;/a&gt;
  &lt;a class="title" threedots="Product Name 2"&gt;&lt;/a&gt;
  &lt;a class="title" threedots="Product Name 3"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>I want to change it to this:</p>
  
  <pre><code>&lt;a class="title" threedots="Product Name 1"&gt;Product Name 1&lt;/a&gt;
  &lt;a class="title" threedots="Product Name 2"&gt;Product Name 2&lt;/a&gt;
  &lt;a class="title" threedots="Product Name 3"&gt;Product Name 3&lt;/a&gt;
  </code></pre>
  
  <p>using JavaScript or jQuery. I can change the first occurrence only with this:</p>
  
  <pre><code>var fullName = document.getElementsByClassName("title")[0].getAttribute("threedots");
  document.getElementsByClassName("title")[0].innerHTML = fullName;
  </code></pre>
  
  <p>But I need help writing a script that can change all of the occurrences. I have researched foreach and HTMLcollection, but I don't understand them. Can someone point me in the right direction for writing a script that will find each <code>&lt;a class="title"&gt;</code> and grab the value for its <code>threedots</code> attribute and inject it in?</p>