Answers for "how to change .innerhtml back"

0

how to change .innerhtml back

<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>
Posted by: Guest on August-28-2020

Code answers related to "how to change .innerhtml back"

Browse Popular Code Answers by Language