I want to display divisors of a number in a text box using loop. But their is some error in my program.I need help to correct it.
`<html>
<head>
<script>
function CheckDivisors()
{
number=parseInt(document.divfrm.num.value);
d=1,sp="\t";
do
{
if(number%d==0)
{
document.divfrm.div.value=d;
document.divfrm.div.value=sp;
}
d++;
}
while(d<=number/2);
}
</script>
</head>
<body>
<form name="divfrm">
Enter a number: <input type="text" name="num">
<br>
Divisors: <input type="text" name="div">
<br>
<input type="button" value="Display Divisors" onClick="CheckDivisors()">
</form>
</body>
</html>
`