Answer to Question #44652 in Programming & Computer Science for victor

Question #44652
The program will ask for a number. Then will display the odd numbers on that number in javascriptv
1
Expert's answer
2014-08-05T02:59:10-0400
<html>
<head>
</head>

<input type="text"id="test" name="test"value="" size="37">
<input type="button"value="Button" onclick="onclickButton()">

<script language="JavaScript">

function onclickButton() {
varstr="";
for(var i=0; i<test.value; i++)
{
if(i%2!=0)
{
str+=i+",";
}
}
alert(str);
}

</script>

<body>
</body>
</html>

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
08.08.14, 16:46

Dear victor, Please provide us with errors log. Thank you.

victor
07.08.14, 14:03

the program is not working

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS