I have an element that has the following CSS style:
#element:after { content: attr(data-percent); }
In an attempt to change the data-percent attribute using jQuery, I used this code:
$('#element').data('percent', '50%');
While the attribute does change (verified with
console.log($('#element').data('percent'));
), it fails to redraw and retains the old attribute value.
What Javascript function do I need to call in order to update this element?