This is really important to fix as soon as possible. I have an absolute headache trying to figure out the mistake and I believe it has to be simple and easily overlooked. My debugger says that the ConvertToCm() and the onclick() function is undefined but I need help in figuring out how to fix that. please someone reply soon.
Code:
<html>
<head>
<title>Metric Conversion</title>
<script type="text/javascript" src="convert.js"></script>
<script type="text/javascript">
function ConvertToCm()
{
var inches, cm ;
inches = parseFloat(document.getElementById('inchBox').value);
cm = InchesToCentimeters(inches);
document.getElementById(outputDiv).innerHTML =
'That is ' + cm + ' centimeters.';
}
</script>
</head>
<body>
<p>Length in Inches:
<input type="text" id="inchBox" size=6 value=1>
<input type="button" value="Convert to Centimeters"
onclick="ConvertToCm();">
</p>
<hr>
<div id="outputDiv"></div>
</body>
</html>