<html> <head> <title>Javascript4#1</title> </head> <body> <script type="text/javascript"> var a="prompt("Type number here.",""); var i=2; var b; var c="true"; while(i<a) { b=a/i; if(b=0) { c="false"; } 1++; } if(c="false") { alert("Your number is not a prime number"); } else { alert("Your number is a prime number"); } </script> </body> </html>

I have the loop that is the basis for weeding out whether it is prime or not, but it is difficult to determine how to output an alert that shows whether it is prime or not.