I have this code to fetch the value of my input
<Script>
var name = document.getElementById("name").value;
I would like to know how to introduce it in a spam for example
I have this code to fetch the value of my input
<Script>
var name = document.getElementById("name").value;
I would like to know how to introduce it in a spam for example
Here's a simple example using just javascript.
var mostrarNome = function (){
var exibicao = document.getElementById("exibir");
var nome = document.getElementById("nome").value;
exibicao.innerText = nome;
}
<input type="text" id="nome" />
<br />
<button type="button" onclick="mostrarNome()">Exibir</button>
<br />
<span id="exibir"></span>