Hello, a very easy way to do this is to use the data binding methodology.
There are many lightweight, easy-to-use frameworks for this, for example Ractive.js
If you want examples I post here, but I'll show you how to do this using just the same 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-response (request-response pattern) method of requesting information from a server, api, webservice, or whatever, and if you get a response without "crashing" page usage, ie performing an asynchronous request .
More on ajax here .