HTML5 Tutorial 5: How to make a Drop Down Menu or SubMenu's

Ok this is requested by alot of Andromo Developers , so lets do it. I suggest if you haven't already to do tutorials 1-4 before taking on this one. I will take baby steps to make sure you understand it. Ok open your text editor and type in the basic template.


Ok save as Submenu.html 
Now go ahead and type in this code all of it is in the body. Type slowly so that
you don't get any error's trust me its alot. Afterward I will explain the code.


<p align="center"><b>Select A Page</b>
<select id="setit" >
<option value="">Select One</option>
<option value="">Andriod forum</option>
<option value="">Android Facebook Group</option>
<option value="">Andromo Forum Webpage</option>
<input type="button" value="Go" onclick="[setit.selectedIndex].value)">


Now on to explaining the code
<form> </form>  The form tag lets HTML know to enclose the code and its elements inside so its not
all of the page.

<p align="center"><b>Select A page</b>  This tells the HTML that the words select a page will be aligned to the center of
the page and all the elements will be centered inside the form.

<select id="setit" > Select is the starting command for the drop down menu. The id="setit" is needed so that when we add
some javascript towards the end this is what the javascript is pointed to. <form> and <select> is html code, but at the end will be javascript
and this will connect the 2.

<option value="">Select One</option>  Option value means the selection your going to make for the user. Now the
first option is usually not selectable so you just put Select One so it shows onscreen this is where the user will click.
The next 3 <option value="">  is the website you point to now the >words go here< Words you want
to display will go here. And then you close it with </option> tag.

Now for the glue that brings it all together.
<input type="button"  ---- means make a button
 value="go" ---- is the words on the button
onclick="[setit.selectedIndex].value)" > this is the glue to it all. Onclick means the button is clickable by the user.
"  ----- means open the browser window 
(setit.options[setit.selectedIndex].value) --- ok remember the id="setit"  ok we use that to connect the button you press to match the command
that you selected in the dropdown menu.

This is alot to take in , it took me 4-5 times before I understood all of it. Here you can download the demo of it

Also if you have any questions on how to use this for other stuff just ask. Cool now we have drop down menu's in Andromo.
I will talk to the staff to see if we can work to make this an activity thats easier to use. But lately Google and the other marketplaces
have been releasing so many updates and rule changes it ridiculous.


Sign In or Register to comment.