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