I've edited the whole answer. I think I understand your question correctly now and I have found a solution.
The code works for me as is in Chrome and Opera, but not in Firefox, IE and Edge.
I found this solution on how to place the caret in any position in a textarea and now it works with your example in the browsers mentioned above (haven't tested IE below 11).
Fiddle: https://jsfiddle.net/bume1up1/2/
The javascript I copied from the SO link above:
function setSelectionRange(input, selectionStart, selectionEnd) {
if (input.setSelectionRange) {
input.focus();
input.setSelectionRange(selectionStart, selectionEnd);
}
else if (input.createTextRange) {
var range = input.createTextRange();
range.collapse(true);
range.moveEnd('character', selectionEnd);
range.moveStart('character', selectionStart);
range.select();
}
}
function setCaretToPos (input, pos) {
setSelectionRange(input, pos, pos);
}
setCaretToPos(document.getElementById("body"), 0);
In some browsers the textarea will be in focus by default, in Firefox you have to tab into the box, but the cursor position remains at the top.