For that, the HTML tag has the input
specifically type="text"
Example to request the name of the user
<input type="text" id="nombre" />
The easiest way to reference the input from JavaScript is to assign it an id (in this example its value is name), although there are other ways.
Then from javascript you can do something like:
var nombre = document.getElementById("nombre").value;
Here I leave you a simple executable example:
function obtenerNombre() {
var nombre = document.getElementById("nombre").value;
alert(nombre);
}
<input type="text" id="nombre" />
<button onclick="obtenerNombre()">Obtener el nombre</button>