JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text"/>
<button id="TaskItem">
click
</button>
JavaScript
const btn = document.getElementById('TaskItem');
const input = document.getElementsByTagName('input')[0]
btn.onclick = (e) =>{
const newBtn = document.createElement('button');
newBtn.innerText = input.value
document.body.appendChild(newBtn)
}