JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" value="nome" />

JavaScript

var input = document.querySelector('input');
input.addEventListener('keydown', function (e) {
    var original = this.getAttribute('value');
    var novo = this.value;
    if (novo == original) this.value = '';
});