Javascript Example
Screen shot
Javascript code to Add two Number

<html>
<head>
<script type="text/javascript">

function add()
{
var num1=prompt("Enter I Number");
var num2=prompt("Enter II Number");
var num3;
num3=Number(num1)+Number(num2);
document.getElementById("result").innerHTML=num3;
}

</script>
</head>
<body>

Click on Button to Add two number <br><br>
<input type="button" onClick="add()" value="Add Two Number" />

<br /><br />

<div id="result"></div>

</body>
</html>

You can download source code here