Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

326
Visualizações
How to change the *actual* value of DOM Input Text Object in Tampermonkey

I am new to Javascript and trying to write a script in tampermonkey to create a button that generates emails on getnada.com

The problem is when you want to create a new email the webpage shows a random combination of username and domain, and I wrote a script that changes the value of the username to a string and the value of the domain to a specific domain, and they do change but when I create the email the webpage creates it according to the values that it showed in the first place not the values that my code entered. here is my script:

// ==UserScript==
// @name         test
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://getnada.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    function randStr(len) {
  let s = '';
  while (s.length < len) s += Math.random().toString(36).substr(2, len - s.length);
  return s;
}
    let btn = document.createElement("button");
btn.innerHTML = "Click Me";
document.body.appendChild(btn);
    btn.onclick = function () {
        document.getElementsByClassName("mt-4 bg-white text-gray-800 active:bg-gray-100 text-xs font-bold uppercase px-4 py-2 rounded shadow hover:shadow-md outline-none focus:outline-none lg:mr-1 lg:mb-0 mb-3")[0].click();
        var delayInMilliseconds = 1
        setTimeout(function() {
            document.querySelector("#grid-first-name").value = randStr(10);
            document.querySelector("#__layout > div > div > div.container.mx-auto.px-4.mb-20 > nav > div.fixed.inset-0.w-full.h-screen.flex.items-center.justify-center.bg-smoke-800.z-50 > div > div > div > form > div > div.inline-block.relative.w-64 > select").value="getnada.com"
            }, delayInMilliseconds);
    }
})();

now what am I doing wrong and how to fix it?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda