html input placeholder add js code example Example: javascript add placeholder to input document.getElementById("myText").placeholder = "Type name here..";