Hello, a very easy way to do this is by using the Binding data methodology.
There are many lightweight and easy-to-use frameworks for this, for example the Ractive.js
If you want examples I put here, but I’ll show you how to do this using only javascript.
var meuCampo = document.querySelector('input');
var paragrafo = document.querySelector('p');
meuCampo.addEventListener('keyup', function () {
paragrafo.innerHTML = meuCampo.value;
});
See that this has nothing to do with AJAX. AJAX is a request methodology (standard request and answer) to request information from a server, api, webservice or anything of the kind and to obtain a response without "locking" the use of the page, that is to say to carry out an asynchronous request.
More about ajax here.
Good answer. Could add an explanation about this not being ajax, since the OP included the tag in the question.
– DontVoteMeDown