var arreglo=[];
var num=document.getElementById('num').value;
if(num == ""){
alert('Campo Vacio');
}else{
document.writeln("Los primos de " +num+ " son: ");
for(i=1;i<num;i++){
for(j=1;j<=i;j++){
if(i%j==0){
cont++;
}
}
if(cont==2){
arreglo[c]=i;
c++;}
cont=0;
}
document.writeln(arrreglo);
}
}