<html>
<head>
<script language=”javascript”>
function call() {
var result, fMath, fEng;
fMath = parseInt(math.value);
fEng = parseInt(eng.value);
result = fMath+fEng;
nResult.value = “<FONT COLOR=”RED”>” +result +”</FONT>”;
}
</script>
</head>
<body>
MATHEMATICS :<INPUT type=”text” NAME=”math”><br>
ENGLISH :<INPUT type=”text” NAME=”eng”><br>
RESULT :<TEXTAREA NAME=”nResult” COLS=”50″ ROWS=”50″ READONLY></TEXTAREA><br>
<input type=”button” name=”add” value=”RESULT” onClick=”call()”>
</body>
</html>
Thanks. On line 9th of this code snippet which is – nResult.value = “<FONT COLOR=”RED”>” +result +”</FONT>”; i want the result variable to appear in red in the textarea. This only restrieves it as string.
Please help, how do i do it?