[ad_1]
You are getting NaN because of this:
var altezza = document.getElementById('altezza');
var base = document.getElementById('base');
(base*altezza/2)
getElementById() does exactly that – gets the element. You just need to get the value from the element e.g. var altezza = document.getElementById('altezza').value;
[ad_2]
solved operations with javascript in html document