JSFiddle - React, Tailwind, and code Playground

HTML

<body>
ID: <input type="text" id="ID"><br>
Password: <input type="text" id="password" onfocus="showMsg()"><br>
<input type="submit" value="Submit" onclick="mark()">

<p id="myPlace"> </p>
</body>

JavaScript

function showMsg(){
	document.getElementById("myPlace").innerHTML="Password must be 6-15charecters";
}

function mark(){
	var pass=document.getElementById("password").value;
    if(pass.length<6 || pass.length>15)
        document.getElementById("myPlace").style.color = "red";
    else
    	document.getElementById("myPlace").style.color = "black";
}