hi,
Please provide me the solution for the coed i have provided below, as i want to display a result in average id box at the main webpage. while entering the values.
Please provide me the solution for the coed i have provided below, as i want to display a result in average id box at the main webpage. while entering the values.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<script>
function average()
{
var math = parseInt(document.getElementById('math').value);
var art = parseInt(document.getElementById('art').value);
var result = math + art;
//how could i display this result in a text box of id "average".
}
</script>
<body>
<input type="text" name="math" id="math" />
<input type="text" name="art" id="art" />
<input type="text" name="average" id="average" onmouseover="return average() " />
</body>
</html>
Comment