In an HTML form field, when using javascript, you must work with the property: Value.
Beispeil:
var ctlTitle = document.getElementById("ctlTitle"); ctlTitle.value = "🎬 " + ctlTitle.value;
|
Here, the character
Note:
For form fields, unfortunately, it is not possible to insert a text as HTML element or child
//var txtVideo = document.createTextNode("🎞"); //if (ctlTitle.childNodes.length > 0) //{ ctlTitle.insertBefore(txtVideo, ctlTitle.childNodes[0]); } //else //{ ctlTitle.appendChild(txtVideo); }
|