how to change color of text in html using javascript code example Example: js element text color element.style.color = '#f0f';