Program:
Output:
<html>
<script>
function add(a , b )
{
var sum = a+b;
alert("Addition: "+sum);
}
</script>
<body>
<input type="button" id="b1" value="Add 2 Interger" onclick="add(10,20)"><br><br>
<input type="button" id="b2" value="Add 2 Float" onclick="add(10.04,20.15)"><br><br>
<input type="button" id="b3" value="Add 1 Interger and 1 Float" onclick="add(10,20.48)"><br><br>
</body>
</html>
Output: