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

94
Vistas
Carrying over data from one html page to another using javascript

Hi i have a two page basic website with a submission box where you write down a name, then a second page that displays "Welcome___", however my website displays ?Welcome=___, I know i need to parse a query string but I'm not sure how to

form.html

<body>
<form action="action.html" method="GET">
<input type="text" name="Welcome" />
<input type="submit" value="Submit" />
</form>
</body> 

action.html

<body>
<div id="write">
<p> Welcome  </p>
</div>
<script>
document.getElementById("write").innerHTML = window.location.search; 
</script>
</body>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To parse the querystring and extract from it the parameter you want the URLSearchParams interface offers useful methods to help you do what you want. A simple implementation might look like this.

<form action='action.html' method='GET'>
    <input type='text' name='Welcome' />
    <input type='submit' />
</form>


<div id='write'>
    <p>Welcome </p>
</div>

<script>
    let args=new URLSearchParams( location.search );
    if( args.has('Welcome') ){
        document.getElementById('write').querySelector('p').textContent += args.get('Welcome');
    }
</script>
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