Advertisement
NecromancerCoding

Leyenda automática v2

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