JSFiddle - React, Tailwind, and code Playground

HTML

<span itemprop="title">God Of War</span>
<div></div>
<button>Do</button>

JavaScript

$(function(){
    $('button').click(function(){
       $('div').attr('class', $('span[itemprop="title"]').html())
               .html('filled a class');
    });
});