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

118
Views
How to get value from page source and put the value to another text field using userscript

I want to get value from below code.

<input name="button" type="button" class="button" onclick="refresh();" id="check_code" style="font-size:15pt; width:80px; height:25px; color:white; border:none;background-color: #845f5f;text-shadow: 1px -1px 0px black;box-shadow: inset 2px -1px 4px 0px black;" readonly="readonly" oncopy="return false" value="my value">

and paste the value got into below text field.

from this
<input type="text" name="verification_code" id="verification_code" style="width:150;">

to this
<input type="text" name="verification_code" id="verification_code" style="width:150;" value="my value">

This is the code I'm working with but it's not working for some reason.

// @name     autoinput
// @match    *://MY_SERVER/*
// @require  https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @grant    GM_addStyle
// ==/UserScript==
//- The @grant directive is needed to restore the proper sandbox.

function test()
{
    var element;
    element = document.getElementById("check_code").getAttribute("value");
    document.setElementById("verification_code").value = element;
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

document.setElementById() is not a function

var value = document.getElementById("source").value;
document.getElementById("dest").value = value;
<input type="text" id="source" value="value" />
<input type="text" id="dest" />

about 4 years ago · Juan Pablo Isaza Report
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!