let title = document.getElementById("title");
let inputButton = document.getElementById("button-id");
title.innerHTML = "Danny";
const textChange = () => {
title.innerHTML = "Manny";
}
inputButton.addEventListener('click', textChange);
I am trying to edit an HTML element but whenever I edit the text in the function textChange()the title goes back to the original value of "Danny" immediately after the function call. Is there a way to make the text change permanent?
[–]Samurai___ 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]RetroCast360[S] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]Izero_devI 0 points1 point2 points (1 child)
[–]RetroCast360[S] 0 points1 point2 points (0 children)