# How to recover unsaved in-progress text from my answer to deleted question, still visible in my local client?

I was in the midst of a lengthy edit to my answer to a question, when the question was deleted before I had saved the new text. The webpage was dynamically updated in my browser tab with an overlay with the message "This post has been deleted and is no longer viewable". My entered unsaved text is still visible underneath the overlay. Although it's so faint it's very hard to read, it is definitely still somehow resident in my browser's rendered page.

According to this recent post, deleting a question which has a correct answer is frowned upon. I would hope that deleting while further good faith efforts are in progress are doubly so. So in accordance with suggestions on that thread, I wanted to request the question be undeleted, so that I may finish my edits. But just one problem...

How can I recover my unsaved in-progress text?

Reloading the page and re-initiating the edit on the answer does not pull up the draft (unlike a new answer, which gets drafts saved). Users with 10K rep can see deleted questions and answers, but have no power to see drafts which were never submitted. Right-clicking and using the HTML inspector has not yielded any success either, though I may just need to navigate to the right DOM node.

Are there any other options? Maybe some javascript I can execute in the browser's console? It's Safari, FYI.

Edit: as of today, 30 Nov 2017, it seems that the software has changed. Now when you're editing an answer to a question that's been deleted, the page gets updated with a banner with the message "This question has been deleted - no more answers will be accepted", not an overlay. But you are no longer locked out of your textarea, so if you want to recover your text, you can just highlight and copy. The browser shenanigans are no longer necessary.

• Perhaps you should get the Question reference ID from the URL (or simply post the entire URL). Only 10K users will be able to see the deleted Question and your Answer, but surely one will be agreeable to retrieve the text for you. Also you could post in the canonical thread for requests to undelete, reopen, reclose, etc. – hardmath Nov 18 '17 at 5:13
• @hard, OP did post in the requests to undelete, etc., thread, and the question has been undeleted, so all is good. – Gerry Myerson Nov 18 '17 at 5:15
• But now John Ma suggests it's a duplicate, and should be closed anyway. – Gerry Myerson Nov 18 '17 at 12:08
• @hardmath The problem is, a 10K user will only be able to see the previously submitted deleted answer. No one will be able to see my in progress edits, which were never submitted and saved to the thread. They only exist in some hidden state in my browser. Recovering these is what this question is about. – ziggurism Nov 18 '17 at 13:37
• @GerryMyerson the undeletion did take place, but this did not cause my in progress edits to be restored. I was able to recover them through browser shenanigans though. My edits are now saved, so even if the question is closed, by work is not deleted. so as you say, all is good. – ziggurism Nov 18 '17 at 13:45

I was able eventually to find the correct HTML node for the textarea containing my unsaved text in the DOM inspector. However the value of this element in the DOM inspector shows only the text contained upon pageload, not the current rendered value, my unsaved draft text. However the javascript console does give the current value.
So in Safari, right-click the <textarea> containing the edited text, and choose "inspect element" (I believe similar tools are included with Firefox and Chrome, which should make this method work). The resulting DOM inspector shows the original text contents of the textarea at the time the page was loaded, and does not include my edits. However copying the id value from the element (eg <textarea id="abc123"...>), and then going to the console tab of the HTML inspector, and entering document.getElementById('abc123') returned the current draft of displayed on the page. All backslashes were escaped in the javascript string, which was annoying to undo manually (probably can make javascript do this for me?), but I got my edits back and am happy. Thanks.