How to put the content in INPUT, Synchronize into the textarea editor?

I have a form page that needs to put the value in the title input, Synchronize, into a prefabricated DIV in the textarea editor below. Worked for a long time, found that Synchronize does not go in, but can Synchronize to some element on the page, but can not Synchronize to a prefabricated element in the textarea editor. Ask for help?

ID:c-title
of the title form in the figure prefabricated a DIV of ID:ctitle in the editor

JS:
< script type= "text/javascript" >
var put1=document.getElementById ("c-title");
var div1=document.getElementById ("ctitle");
put1.onkeyup=function () {

div1.innerHTML=put1.value;

}
< / script >

Mar.22,2021

this problem may be that there is no DOM node where id is ctitle on the page. You can add the following code to take a look at the output information of the console

put1.onkeyup=function(){
   console.log(div1);
   div1.innerHTML=put1.value;
}
Menu