Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('li#kids a').children().andSelf().contents().each(function() {
- if (this.nodeType == 3) {
- $(this).replaceWith($(this).text().replace(/(\w)/g, "<span id='ch_text'>$&</span>"));
- }
- });
- $('span#ch_text').each(function(i) {
- i = i+1;
- $(this).addClass('char' + i);
- });
Add Comment
Please, Sign In to add comment