I have this sample code:
window.addEventListener('load', () => {
// sticky profile notes
const notes = document.querySelector('#id_notes'); // Get textarea element
const headerDiv = document.createElement("div"); // Create a <div> element
headerDiv.innerHTML = "SHOULD BE ON TOP"; // Insert instructions
// add header on top
notes.prepend(headerDiv);
});
<body>
<textarea id="id_notes" style="background-color: #ffffcc;">
</textarea>
</body>
in which I plan to add a header the same size as the textarea. but instead of it being added on top of the textarea, its being added inside it.
I can only use JS because I don't know how to add it on a Django template. Thanks in advance!
EDIT: added desired end result:
