I have a string of raw text which looks something like this:
1 . . 3 . 4 . | A . A . N . | 1 . 1 . . .
I sadly cannot access the source code, but need to add a span with a class to each of those characters, so that the outputted HTML would look something like this:
<span class="1">1</span> . . <span class="3">3</span> . <span class="4">4</span> . <span class="divider">|</span>
What would be the best way to do that using jQuery?
you need String.replace
in response to the comment
this reads html from the div, performs the replace operation and put html back to the document.