<!DOCTYPE html>
<html>
<body>
<form>
Base:<br>
<input type="text" id="base" name="base"><br>
Height:<br>
<input type="text" id="height" name="height"><br>
<br>
<button type="button" onclick="calculateArea()">Calculate Area</button>
<br><br>
Area: <span id="result"></span>
</form>
<script>
function calculateArea() {
var base = document.getElementById("base").value;
var height = document.getElementById("height").value;
var area = (base * height) / 2;
document.getElementById("result").innerHTML = area;
}
</script>
</body>
</html>Kendinize göre değişkenlerinin ismini değiştirebilirsiniz.