JSFiddle - React, Tailwind, and code Playground

HTML

Enter your name: <input type="text" id="fname" onkeyup="myFunction()">

JavaScript

function myFunction() {
    var input = document.getElementById("fname");
    var para = document.createElement("p");
		var node = document.createTextNode("This is new.");
		para.appendChild(node);
    
    if (input.value < 3){
    	input.appendChild(para);
    }
}