JSFiddle - React, Tailwind, and code Playground

by hescano

HTML

<input type="button" value ="Add" id="btn" />
<div id="elements"></div>

JavaScript

document.getElementById("btn").onclick = function(){
    
    var txt = document.createElement('input');
    txt.type = "text";
    document.getElementById("elements").appendChild(txt);
};