79269163

Date: 2024-12-10 17:32:59
Score: 0.5
Natty:
Report link

The answer posted above works perfectly but here is another approach I found

apex.jQuery("span[data-style]").each(
  function()
  { 
    apex.jQuery(this).
      parent().parent().attr( 'style'
                   , apex.jQuery(this).attr('data-style')
                   ); 
  }
);

The only difference being that you are targeting the "grandparent" element by including an extra use of .parent()

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Jason Bourne