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()