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

127
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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