<html>
<head>
<title>JS </title>
<script type="text/javascript">
function sum(){
var a = parseInt(document.getElementById('num1').innerHTML);
var b = parseInt(document.getElementById('num2').innerHTML);
var c = a/b;
function discount(a, b) {
return a * (1 + 0.01 * b);
}
alert(discount(100, -20));
document.getElementById('num3').innerHTML=c;
}
</script>
</head>
<body onload="sum()">
<font id="num1">1000</font> - <font id="num2">10%</font> = <font id="num3"></font>
</body>
</html>