<script language="javascript" type="text/javascript">

function c(color, fontSize)
{
var txt = document.getElementById("tar");
var div = document.createElement("DIV");
div.innerText = txt.value.toString();
div.style.color = color;
div.style.fontSize = fontSize;
txt.innerHTML = '';
txt.appendChild(div);
}</script>
</HEAD><BODY>
<input type="button" onclick="c('red', 15);" value="Red">
<input type="button" onclick="c('blue', 18);" value="Blue"><br />
<TEXTAREA id="tar" NAME="" ROWS="5" COLS="10">Hello world!</TEXTAREA>
</BODY>
</HTML>