title: JS get element html and lowercase/hyphenate and add as class to parent
body: <p>I hope the title makes sense, I am trying to get the HTML of an element in each     li element so e.g. </p>
  
  <pre><code>&lt;li&gt;&lt;a class="title"&gt;Free Stuff&lt;/a&gt;&lt;/li&gt; 
  </code></pre>
  
  <p>I am trying to get the html "Free Stuff" and lowercase that, remove the white space and add a hyphen then use that as the class name on the li, so the end result means the li will be </p>
  
  <pre><code>&lt;li class="free-stuff"&gt;
  </code></pre>
  
  <p>I hope this makes sense. If you are wondering why I am using JS to do this its because I cant use php due to the nature of the wordpress plugin and not touching plugin core files for update purposes.</p>