So let’s begin with simple one,
First, create a new HTML file.
Then add event function on the button, like this
then next is type
var b = document.getElementById(“b”).value;
var h = document.getElementById(“h”).value;
var c = (b*h)/2;
var b is a declaration from variable b that having the value from the element on our pages which having “b” to be it id.
console.log(c) is showing us the result from a formula on the console. There’s many ways to show the result like put it on alert, or just put it on another element at our web pages.