Check out example codes for "how to change .innerhtml back". It will help you in understanding the concepts better.

Code Example 1

<div id="d"> old content </div> 
 
<script> 
    // Element stored in a variable for easy access 
    var div = document.getElementById("div"); 
 
    // Save the original content of the div 
    var old = div.innerHTML; 
 
    // Change the content of the div 
    div.innerHTML = "new content"; 
 
    // Reset the original content of the div 
    div.innerHTML = old; 
</script>

Code Example 2

document.getElementById("p1").innerHTML = "New text!";

Learn ReactJs, React Native from akashmittal.com