document.getElementById("myH2").style.color = "#ff0000"; document.getElementById("myP").style.color = "magenta"; document.getElementById("myDiv").style.color = "lightblue";
document.getElementById("yourInputID").style.color = 'the color of your choice';
element.style.color = '#f0f';
<!DOCTYPE html> <html> <head> <script> function display() { var col=document.getElementById("demo"); col.style.color="#FF0000"; } </script> </head> <body> <h1>My First JavaScript</h1> <p id="demo">click on the button below.....</p> <button onclick="display()">Display</button> </body> </html>