change textbox color javascript code example
Example 1: javascript change color of text input
document.getElementById("yourInputID").style.color = 'the color of your choice';
Example 2: onclick change text color javascript
<script>
document.getElementById('change').onclick = changeColor;
function changeColor() {
document.body.style.color = "purple";
return false;
}
</script>