I need help with a project I'm doing in school

javascript

#1

I need help figuring out why my var numCheck and var answer are NOT displaying more than once. I have to display all the divisors of the numEntry input. Please help.


#2
<script>
<!--

function prime() {

	var numEntry = document.getElementById('numEntry').value
	
	var numCheck = 2
	
	var answer
		
	if ((numEntry >= 1) && (numEntry <= 9999)) {
	
		if (numEntry % numCheck == 0){
		
			while (numCheck <= numEntry) {
				answer = numEntry / numCheck
		
				document.getElementById("result").innerHTML = "<br />This is not a prime number because it is divisible by: <br /><br />"
				document.getElementById("result").innerHTML += numCheck + "&nbsp; &nbsp; &nbsp;" + answer + "<br /><br />"
			
				numCheck++
			}	
			
		} else {
			document.getElementById("result").innerHTML = "<br />This number is a prime number."
			}
	
	} else {
		alert("Please type a number between 1 and 9999.")
		document.getElementById("numEntry").focus()	
		}
}

-->
</script>

#3

This was resolved personally, some time ago.