JSFiddle - React, Tailwind, and code Playground
HTML
<div id="first" data-portlet="151" class="portlet new" >some content here</div>
<div id="another"></div>
JavaScript
$('.portlet').each(function() {
var obj = $(this),
objD = $(this).data();
$('#another').addClass( 'portlet_' + objD.portlet + ' ' + 'portlet_content_' + objD.portlet ).html( $('#another').attr('class') )
});