JSFiddle - React, Tailwind, and code Playground

by Vetrivel Samidurai

HTML

<p id="heading_text">

welcome

</p>

Enter your text: <input type="text" id="user_inputid" />

<button type="button" onclick="showmytext()">
Click ME
</button>

JavaScript

function showmytext()
{
var ptext = document.getElementById("heading_text").innerHTML;
var userinputtext = document.getElementById("user_inputid").value;

document.getElementById("heading_text").innerHTML=userinputtext;

}