JSFiddle - React, Tailwind, and code Playground
HTML
<p data-text="dict.dataP"></p>
<div id="dummy"></div>
JavaScript
var dict = {
"dataP": "this is my p tag text",
"dataDiv": "dummy div"
};
$.each(function () {
if ($(this).attr("data-lang").length > 0) {
$(this).html(
$(this).attr('data-lang') /*we got a problem here*/ );
}
});
$("#dummy").html(dict.dataDiv);