Convert slug variable to title text with javascript
<p>I'm trying to do something that would be similar to turning a url slug-like variable into text that could be used for a title.</p>

<p>So, I have a variable for example that is like this:</p>

<pre><code>var thisID = 'athlete-profile';

function myFunc(thisID) {
    // i need to use thisID as the id and href in a loop that generates a string of &lt;li&gt;&lt;a&gt;'s\

    function makeTitle(thisID) {
        // convert thisID to text so for this example it would return 'Athlete Profile'
        return 'Athlete Profile';
    }

    for () {
        var str = '&lt;li id="'+thisID+'"&gt;&lt;a href="#'+thisId+'"&gt;'+makeTitle(thisID)+'&lt;/a&gt;';
    }
    // make sense?
}
</code></pre>

<p>I'd like to not use a regex to do this if possible somehow, but I don't think there's a way to do it without one. So any one who knows how to do this type of thing let me know, it would be a great help.</p>

<p>Thanks</p>
