how to get random color on text using javascript dom w3school code example Example: js element text color element.style.color = '#f0f';