Trying to get math.pow function to display but it will not. The labels should the answer to 77^39 mod 517, etc.
<body>
<p><input type="button" value="Encrypt Message" id="encButton"
onClick="encrypt()" name="encButton" /></p>
<p id="encryptResultLabel1"></p>
<p id="encryptResultLabel2"></p>
<p id="encryptResultLabel3"></p>
<p id="encryptResultLabel4"> </p>
</body>
<script>
function encrypt(){
var g = ((math.pow(77, 39)) % 517);
var h = ((math.pow(65, 39)) % 517);
var j = ((math.pow(84, 39)) % 517);
var k = ((math.pow(73, 39)) % 517);
DisplayResult(g, "encryptResultLabel1");
DisplayResult(h, "encryptResultLabel2");
DisplayResult(j, "encryptResultLabel3");
DisplayResult(k, "encryptResultLabel4");
}
</script>
use
Math
instead ofmath
.Refer this link for more detail.