Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

318
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!