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

282
Vistas
How to pass values from one HTML page to other HTML page using Javascript

I have a HTML page (test.html), where i've a text box and a button. I'll enter some text in the text box and Click that button, it should open a new page (say google.com) and paste the value i entered in the previous page and automatically submit the page. I was able to achieve this in VB script which is supported in IE and not in Edge or Chrome. So is there a way we can achieve this using Javascript.

Tried, things like this, but it doesn't work.

    const testDiv = document.forms["actionForm"].getElementsByTagName("applicationIdentifier")
    testDiv.textContent = 'Hello world!'
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

JavaScript can only run within the page it is loaded on. Also, HTTP is stateless.

If you want to interact with other pages, they will need to support the interaction by means of their code allowing you to specify their state. For GET requests, this can be done using URL parameters. To take your example, Google supports a query parameter.

https://www.google.com/search?q=mdn+http

Most sites will not document this kind of thing because it is a strange way to interact. They usually expose their interactions via APIs.

open a new page (say google.com) and paste the value i entered in the previous page and automatically submit the page

If you want to actually simulate these user actions, this cannot be done from the browser. At that point, you are describing a WebDriver, for example Selenium or WebDriverIO.

It is even possible to experiment with something like java.awt.Robot here, but I do not recommend it.

If by chance I am off-base and you just want a Google search bar for your site, there are ways to do that.

https://support.google.com/programmable-search/answer/4513903?hl=en

Depending on your goals, <iframe> might also suit your ideas. But using <iframe> is generally not recommended.

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