How Do I Automate Fill of GMail Compose Form?

Javascript
Is there a way to ‘insert’ the text in the field and not over write any text that may be in the field already.

var subjectElem = document.querySelectorAll(’[name=“subjectbox”]’);
subjectElem[0].value = “Test Subject”;

if the subjectbox already had the text ‘hello world’ then the resulting subjectbox would be "hello worldTestSubject"
many thanx