i have a button which expands and hides text. However im not sure how to change the value of the text. What i mean by that is when i click on the expand button that says "expand" it doesnt change to "hide" it stays as "expand". I tried it in javascript but wasn't completely sure how to apply it to the html :(
function btnChanger() {
var i = 0;
if(i % 2 == 0)
{
document.getElementById("hide").value="Hide";
}
else
{
document.getElementById("hide").value="Expand";
}
i++;
}
If it's easier to do in Jquery? Im not too sure, thank in advance :) Here is the Jfiddle: https://jsfiddle.net/dmgnsx17/3/