Copyright: W3Schools.com

 
<!DOCTYPE html> <html> <head> <script> function newColor(color) { document.getElementById('x').style.color=color; } </script> </head> <body> <p>This example demonstrates how to change the text color of a textarea.</p> <p>Mouse over the three colored table cells, and the textarea will change color:</p> <table width="100%"><tr> <td bgcolor="red" onmouseover="newColor('red')">&nbsp;</td> <td bgcolor="blue" onmouseover="newColor('blue')">&nbsp;</td> <td bgcolor="green" onmouseover="newColor('green')">&nbsp;</td> </tr></table> <form> &lt;textarea id="x" rows="5" cols="20"> This is some text in a text area. This is some text in a text area. This is some text in a text area. This is some text in a text area. &lt;/textarea> </form> </body> </html>

 Copyright: W3Schools.com