I'm trying to get a colour from a data-attribute (that can be different per page) and pass that colour into a ::before/::after with jQuery. Currently have this:
var colour = $('.subtitle.fancy').attr('data-attribute');
$('.blog-footer .subtitle.fancy span').after(function(){
$(this).css('border-bottom', '2px solid #' + colour);
});
Obviously not working - is there a way to make this work?