JSFiddle - React, Tailwind, and code Playground
HTML
<div class="holder">Email Adress <span class="red">*</span></div>
<input id="input" size="18" type="text" />
CSS
.holder {
position: absolute;
margin: 7px 8px;
color: #A3A3A3;
cursor: auto;
font-family: Helvetica;
font-size: 11pt;
z-index: 1;
}
.red{
color: red;
}
input {
padding:5px;
font-size:11pt;
}
JavaScript
$(function() {
$(".holder + input").keyup(function() {
if($(this).val().length) {
$(this).prev('.holder').hide();
} else {
$(this).prev('.holder').show();
}
});
$(".holder").click(function() {
$(this).next().focus();
});
});