JSFiddle - React, Tailwind, and code Playground
HTML
<input id="myInput" value="Default Input Value" />
CSS
#myInput { color: #999; }
JavaScript
var myInput = document.getElementById("myInput");
myInput.onfocus = function () {
if (this.value == "Default Input Value") {
this.value = "";
this.style.color = "#000";
}
}
myInput.onblur = function () {
if (this.value == "") {
this.value = "Default Input Value";
this.style.color = "#999";
}
}