Guest User

Untitled

a guest
May 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. $('li#kids a').children().andSelf().contents().each(function() {
  2. if (this.nodeType == 3) {
  3. $(this).replaceWith($(this).text().replace(/(\w)/g, "<span id='ch_text'>$&</span>"));
  4. }
  5. });
  6.  
  7. $('span#ch_text').each(function(i) {
  8. i = i+1;
  9. $(this).addClass('char' + i);
  10. });
Add Comment
Please, Sign In to add comment