JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test_A" >test</div>

JavaScript

var p_id = $("#test_A").attr("id");
alert(p_id);
$('#test_A').append("<scrip" + "t" + ">alert(" + p_id + ");</"+"script>");