javascript – How can I make a string appear in a certain location from localstorage?


I have the following code:

<html>
  <div id = "text" contenteditable = "true"></div>
</html>

<script>
function loadsaved() {

 let stringValue = document.getElementById("text").innerHTML;
 let y = localStorage.getItem("savetext");

}
</script>

What I want is, when I press the button, it’ll load the string that was saved in local storage in that div text box. How can I achieve this?