Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

213
Vistas
How to fill text field using JavaScript?

I am trying to open a webpage from my JavaScript function:

function fillText() {   
      window.open("https://Somerandonwebsite.com/task");      
  }

The webpage : "https://Somerandonwebsite.com/task" has a text box with the following tag:

<input type="text" id="titleBox" autocomplete="off" aria-label="Title Field" title="" placeholder="Enter Title" aria-invalid="true">

I want to add string "Title created" to the text box with the id titleBox

How can I achieve this in the function? I am also confused whether to add the string first and open webpage or open webpage and access text box to fill my string

How can I access text box to fill this string into the text box on opening web page?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As @Carsten Løvbo Andersen's comment said if you own both sites, you can just pass some query strings from your function to your site. E.G.

function fillText() {   
  window.open("https://Somerandonwebsite.com/task?string=yourString");
}      

Then, at your Somerandonwebsite.com, simply create a script:

var input = document.getElementById("titleBox");
const params = new URLSearchParams(window.location.search)
input.value = params.get("string")

This will make your text box display your query string named string

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda