As the title says I want to have string classes rather than numeric, this is the script I currently have!
$('ul#nav li').each(function (index, element) {
$(element).addClass('number_' + (index+1).toString());
});
And this is what I get, it works fine and nothing wrong with it;
<ul id="nav">
<li class="number_1"></li>
<li class="number_2"></li>
<li class="number_3"></li>
<li class="number_4"></li>
<li class="number_5"></li>
</ul>
But I want it to return the classes as in string and NOT numeric! So something like this;
<ul id="nav">
<li class="first"></li>
<li class="second"></li>
<li class="third"></li>
<li class="fourth"></li>
<li class="fifth"></li>
</ul>
PLEASE NOTE: These classes are generated/added dynamically, therefore the string classes should be added dynamically, so may have 100 list items!
Thank you for your time, appreciate any help :)