How to make the changes permanent?

0

Hello, I am learning javascript and I am doing a code that when I click on a tag p the existing content is modified by a textarea that I then modify for another text. I already achieved it

The code I used was

Function modificar(e) {
 G = e.getattribute('id')
Documentos.getelementbyid(G).innerHTML = "< id ='cambio' textarea></textarea> y < onclick='modificar2' button>"

Función modificar() {
Var f = Documentos.getelementbyid('cambio')
Document.getelementbyid('G').innerHTML = f

Now how do I make the change permanent on the page?

    
asked by hackcomet 24.09.2017 в 23:30
source

1 answer

0

If it's just in the browser, try using localStorage

localStorage.setItem ("p_text", "your_text"); document.getElementById ("G"). innerHTML = localStorage.getItem ("p_text");

    
answered by 25.09.2017 в 03:48