Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!