This is the function that I write for exponentiation like the Math.pow function in JavaScript.
Code:
function tavan(){
var adad=document.getElementById("pain").value;
var tavan=document.getElementById("bala").value;
var kol=adad;
while((tavan-1)>0)
{
kol=kol*adad;
--tavan;
}
document.getElementById("main").innerHTML=kol;
}
After testing this function, everything seems right. Then I test this Phrase 4^28 and the result is 720575940379279**40**. In windows calculator it was 720575940379279**36** my function number was 4 bigger than real.