1
I have a plan form, and I would like that by clicking acquire, it already fill out a brief message on the form. I’m trying this way, but it doesn’t return values
window.onload = function (){
var mensagem = document.getElementById('mensagem');
var button = document.getElementById('button');
var assinatura = '\n\nParabéns!!\nEscolheu o plano basic..'
button.addEventListener('click', function() {
mensagem.value += assinatura;
});
}
<form>
<textarea id="name" name="testa"></textarea>
<button id="teste" type="button">Testando</button>
</form>
(Remembering that the above is just a test)