JSFiddle - React, Tailwind, and code Playground
by Gourav Singh
HTML
<span id="thisSpan">
</span>
JavaScript
window.onload = function() {
someFunction();
};
function someFunction()
{
var textBox;
textBox = createTextBox("thisSpan", "textBox");
textBox.onclick = function() {textBox.value = "";};
//alert();
// Fn to read value from text box by #id
deleteTextBox("thisSpan", textBox);
}
function createTextBox(whereToId, newTextBoxId)
{
var textBox = document.createElement("input");
textBox.type = "text";
textBox.id = newTextBoxId;
document.getElementById(whereToId).appendChild(textBox);
return textBox;
}
function deleteTextBox(removeFromId, element)
{
document.getElementById(removeFromId).removeChild(element);
}