JSFiddle - React, Tailwind, and code Playground
HTML
<div class="form">
<input id="Fname" type="text" value="" autocomplete="off" required />
<input id="Status" type="text" value="" autocomplete="off" required />
<input id="Department" type="text" value="" autocomplete="off" maxlength="10" required
<input id="Year" type="tel" value="" autocomplete="off" maxlength="1" required />
</div>
<div>
<span id="PreviewFname">PRENOM</span>
<span id="PreviewStatus">STATUT</span>
<span id="PreviewDepartment">DEPARTEMENT</span>
<span id="PreviewYear">ANNEE</span>
</div>
JavaScript
$('.form').find('input').on('keyup', function () {
var id = this.id;
var val = $(this).val();
var Ids2Valeurs={"Fname" : 'PRENOM', "Status" : 'SATUT', "Department" : 'DEPARTEMENT', "Year" : 'ANNEE' }
if (val =="") {
$('#Preview'+id).text(Ids2Valeurs[id]);
}
else
{
$('#Preview'+id).text(val);
}
});