title: Removing duplicate words in html element text?
body: <p>I have a small problem with replace words in html. </p>
  
  <pre><code>&lt;p id ="demo"&gt;Hello, Hello how are you! &lt;/p&gt;
  </code></pre>
  
  <p>I want final result like this:
  Hello, how are you!</p>
  
  <p>It should to filter it to remove duplicate items, join them back.</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>var span = document.getElementById('demo'),
      text = span.innerHTML.split('').filter(function (allItems,i,p) {
     return i == p.indexOf(allItems);
      }).join('');
      
      span.innerHTML = text;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p id ="demo"&gt;Hello, Hello how are you &lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>