function insertDateTimeAndSimulatedRows() { var timestamp = new Date().toLocaleString(); var textArea = document.getElementById("simulatedTextarea"); textArea.value += timestamp + "\n"; textArea.value += "[Input 1]\n[test]\n[Input 3]\n\n"; textArea.value += ""; textArea.value += "
"; textArea.value += ""; textArea.value += "
"; textArea.value += ""; textArea.value += "
"; textArea.value += ""; textArea.value += "
"; textArea.value += ""; textArea.value += "
"; // Set focus to the textarea textArea.focus(); } function saveContent() { const textareas = document.getElementsByTagName("textarea"); for (let i = 0; i < textareas.length; i++) { localStorage.setItem(textareas[i].id, textareas[i].value); } } function loadContent() { const textareas = document.getElementsByTagName("textarea"); for (let i = 0; i < textareas.length; i++) { const savedContent = localStorage.getItem(textareas[i].id); if (savedContent) textareas[i].value = savedContent; } } // Load content and set up event listeners when the page is fully loaded document.addEventListener('DOMContentLoaded', () => { loadContent(); document.querySelectorAll("textarea").forEach(element => { element.addEventListener("input", saveContent); }); });