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';
}