My goal is to set the padding-right css property based on the width of a child element. Here's my approach:
Using jQuery
$('.parent_element').css('padding-right', $(this).children('.child_element').width() + 'px');
Here's the HTML structure:
<a href="#" class="parent_element"><i class="fa"></i> Example <span class="child_element">101</span></a>
However, this code doesn't apply the desired css to the parent element.