how to change text color js html code example
Example 1: onclick change text color javascript
<script>
document.getElementById('change').onclick = changeColor;
function changeColor() {
document.body.style.color = "purple";
return false;
}
</script>
Example 2: how to change color of font in js
element.style.color = '#f0f';