How to write a RGB color value in JavaScript?

Sometimes, we want to write a RGB color value in JavaScript.

In this article, we’ll look at how to write a RGB color value in JavaScript.

How to write a RGB color value in JavaScript?

To write a RGB color value in JavaScript, we set the color to an rgb string.

For instance, we write

parent.childNodes[1].style.color = "rgb(155, 102, 102)";

to set the color property to the color string we want.

Conclusion

To write a RGB color value in JavaScript, we set the color to an rgb string.