• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

107
Vistas
local storage get item will gone when i refreshing the page

im new javascript learner,and i have problem to display the local storage.getitem value when i will refresh the page,can any one help me please,and thank you for the help,this is my code;

function myFunction() {
  var c = document.getElementById('myinput').value;
  historyarr.push(c);

  localStorage.setItem('user', JSON.stringify(historyarr))
  console.log(typeof(historyarr))
  displayonpage(historyarr)
}

function displayonpage(c) {
  return result.innerHTML = JSON.parse(localStorage.getItem('user')).join('<br>')
}
almost 3 years ago · Juan Pablo Isaza
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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda