I would like to know how I can change the button text every time I click on it, as if it were a list-group when it clicks it opens and closes, I made this code:
function trocarFlecha()
{
var x = document.getElementById('btnImage').value;
if (x = "Imagem ˅") {
document.getElementById('btnImage').innerHTML = "Imagem ˂";
} else {
document.getElementById('btnImage').innerHTML = "Imagem ˅";
}
}
And I added a onclick="trocarFlecha()"
to the button and it only changes once but I wanted to do it dynamically, doing that every time I click it it changes.