Copyright: W3Schools.com

 
<html> <head> <script type="text/javascript"> function newColor(color) { document.getElementById('x').style.background=color; } </script> </head> <body> <p>This example demonstrates how to change the background 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> <textarea id="x" rows="5" cols="20"> This example can not be edited because our editor uses a textarea for input, and your browser does not allow a textarea inside a textarea. </textarea> </form> </body> </html>

 Copyright: W3Schools.com