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

179
Vistas
how to change the text of a button and keep this change until I click again (using Javascript)

I have a button with the text "follow" which changes text when clicked and becomes "unfollow". However when I reload the page the text modification does not remain and the button text returns to "follow".

How do I keep the new "unfollow" text after reloading the page?

Note that this is a single page app so I cannot use the <body onLoad="follow()"> method.

$('#myPosts1').append('<button data-role="button" data-inline="true" data-mini="true" id="btn1" onClick="follow()" data-theme="b">FOLLOW</button>');

function follow() {
  const btn1 = document.getElementById("btn1");
  btn1.innerHTML = 'UNFOLLOW';
}
about 4 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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda