Question #44652

The program will ask for a number. Then will display the odd numbers on that number in javascriptv

Expert's answer

<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!

LATEST TUTORIALS
APPROVED BY CLIENTS