Enkille,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
</script>
<script>
$(function(){
function doCalc(inputDiv, resultDiv, resultName){
var value;
value = Number($(inputDiv).val())||0;
$(resultDiv).text(resultName +": "+ value + " cm");
return value
}
function sum()
{
var width = doCalc("#input-width", "#width-result", "Ширина");
var height = doCalc("#input-height", "#height-result", "Высота");
$("p").text(width + height);
}
$("input").on({"input" : sum});
sum()
})
</script>
</head>
<body> <p></p>
<input type="text" id="input-width" value="10" ><div id="width-result"></div>
<input type="text" id="input-height" value="23"><div id="height-result"></div>
</body>
</html>