I have some HTML:
<div id="tagCloud">
<a class="5" title="1 records" href="tags=Battleship">Battleship</a>
<a class="4" title="1 records" href="tags=Cabbage">Cabbage</a>
etc...
I want to take the class value, and convert it to a word.
So if class = 5 append class five?
This will replace all classes called 5:
If you want to automate it for any class with a digit name, then it is going to be more difficult. I would make a custom selector that could pick out classes with only numbers (based on regex), then use each to loop through and find out what that number was, for each element, and then create a function for translating a number into english, and then add that class. Note that this wouldn’t be terribly fast though.