The color property sets the foreground color of an element (typically, the color of the text).
color − should be any valid color value.
All the HTML elements.
object.style.color = "#a1a1a1";
Here is the example which shows effect of this property −
<html> <head> </head> <body> <h2 style = "color:olive;"> This text will have olive color. </h2> <p style = "color:#3300CC"> This text will have blue color. </p> <div style = "color:rgb(224,37,197);"> This text will have pink color. </div> </body> </html>
This will produce following result −