Advertisement
NecromancerCoding

Leyenda automática v1

Oct 2nd, 2021 (edited)
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.42 KB | None | 0 0
  1. $('.groups a').each(function(){
  2. var color = $(this).css('color');
  3. var clase = $(this).text().replace(/\s/g, '').toLowerCase().replace(/'/g, "").replace(/\(|\)/g, "").slice(0,10);
  4. $(this).attr('style', '--group:'+color+';');
  5. $(this).parent('b').replaceWith(this);
  6. $(this).addClass('gr'+clase).removeClass('gensmall');
  7. });
  8.  
  9. $('.groups').each(function(){
  10. var content = $(this).children('a');
  11. $(this).html(content);
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement