Hello people im new to the forums and thought this would be a great way to start my learning curve
im fiddeling about with javascript and learning the basics.
say you make a javascript array keeping it simple for just now, say the array had 5 items in it, how can you make it so the user has to input a number or a name which selectes one of the objects from the array ?
this is the code iv got atm, just simple stuff i have been learning off w3c.
so what i can imagine a prompt box appears and the user types in ether "1" or "Saab" Which will bring it up on the screen
HTML Code:<html> <body> <script type="text/javascript"> var i; var myCars=["Saab","Volvo","BMW","Ford", "Astin Martin"]; // literal array document.write(myCars[0]); </script> <form action=""> please enter number from 1 - 5 <input type="text" name="array" /><br /> </form> </body> </html>
Thanks for your input and time
Kind Regards
Adam




Reply With Quote





Bookmarks