Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why i can get the "output" ? Wait for you helpful knowledge

Name: Anonymous 2018-01-26 22:56

Sorry is Why i can't get the "output" ? Wait for you helpful knowledge
HTML File

<!DOCTYPE html>
<html>
<head>
<title>Area of a Triangle</title>
</head>
<body>
<h1>Area of a Triangle</h1>
<p>
Base: <input type="text" size="4" id="base">
Height: <input type="text" size="4" id="height">
<br>
<button type="button" onclick="triangleArea()">AREA</button>
</p>
<p id="output"> </p>

<script src = "triangleArea.js"></script>

</body>
</html>



traingle.js

var triangleArea = function () {
var base = parseFloat(document.getElementById('base').value);
var height = parseFloat(document.getElementById('height').value);

var output = document.getElementById('output');

if (isNan(base) || isNan(height)) {
output.textContent = 'You did not enter two number';
}else
{
var area = 0.5 * base * height;
output.textContent = 'Area = ' + area;
}
};

Name: Anonymous 2018-01-26 23:10


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List