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

316
Views
Cambiar el valor del botón/Mostrar texto usando Javascript

Estoy usando un complemento (por lo que no tengo acceso para editar HTML) para una ventana emergente de verificación de edad en mi sitio web. Quiero cambiar el texto que se muestra en cada uno de los dos botones, que actualmente se extrae del atributo de valor HTML.

ingrese la descripción de la imagen aquí

Este es el HTML para cada botón:

<input type="button" name="confirm_age" id="confirm_age" value="I am 18 or older [Enter Site]" style="background-color:#2dc937; width:300px;" tabindex="1">

<input type="button" name="not_confirm_age" id="not_confirm_age" value="I am under 18" style="background-color:#cc3232; width:300px;" tabindex="1">

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Como dijo @vanblart, puedes usar:

 document.querySelector("#confirm_age").value = "New Value"

Si el complemento se toma su tiempo para mostrar los botones, puede envolver el código anterior en un temporizador con setTimeout() :

 setTimeout(function() { document.querySelector("#confirm_age").value = "New Value" }, 2000);
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!