Jimmi,
<script>
for (var i=2; i<=10; i++) {
var count = 0;
for (var j=2; j<=i; j++) {
if (i%j) {continue;}
count += 1;
}
if (count == 1) document.write(i);
}
</script>
<script>
for (var i=2; i<=10; i++) {
var count = 0;
for (var j=2; j<i; j++) {
if (i%j) {continue;}
count += 1;
}
if (!count) document.write(i);
}
</script>
<script>
for (var i=2; i<=10; i++) {
var count = 0;
for (var j=1; j<=i; j++) {
if (i%j) {continue;}
count += 1;
}
if (count == 2) document.write(i);
}
</script>