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

250
Vistas
How can I have a variable of a clone (html elements) appear in another document and not disappear when I refresh [pretty new]

So basically I'm trying to make a very simple add to cart button.

You click, you can continue "browsing" and when you click to go to the cart it will be there in the format I have it set up in.

I don't exactly need help with having it appear with the right text but mostly with cloning it and then appearing in a entirely different document.

I've tried cloneNode, but that simply appears on the same document.

If you know of any functions/way's to help that would help me a lot.

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

0

You can achieve this in many ways. From storing a value as a parameter in an URL, using localStorage, cookies, make your own state manager or use Redux, React Context API, MobX, etc.

Try with localStorage API.

localStorage.setItem('cartProduct', cartProduct)

then you can read it with

localStorage.getItem('cartProduct)

https://www.taniarascia.com/how-to-use-local-storage-with-javascript/

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