JSFiddle - React, Tailwind, and code Playground

HTML

<span class="swatch" style="background-color: #d1f2a5;"><strong>paste here</strong><em></em></span>

JavaScript

$('span.swatch > strong').css('background-color', $('span.swatch').css('background-color'));