In the script below, I want to keep the initial value of htmlStrTOCpre static so that it does not change. However, once I edit the text area, the undo will no longer paste the original text back into the textarea. I believe its because the htmlStrTOCpre is based on the html() of textarea at the time the undoTOC function is called, and not the initial value on page load.
How can I store that initial value, so that I can always paste it back into the textarea (via the undoTOC function)?
Table of Contents
Paste TOC | Undo
以上就是jQuery to store initial value of textarea的详细内容，更多请关注web前端其它相关文章！