document.addEventListener("DOMContentLoaded", function () { var mainTextarea = document.getElementById('mainTextarea'); var editorTextarea = document.getElementById('editorTextarea'); // If exist then copy from main_textarea to editor_testarea if (mainTextarea && editorTextarea) { editorTextarea.value = mainTextarea.value; } // Hide the original textarea if (mainTextarea) { mainTextarea.style.display = 'none'; } });