04 Dec 2009 @ 4:40 PM 

How to create drop-down menu?

Let’s start, I’ll show you 2 examples, first one will allow only to chose something from the options list, second one will allow you to choose an option and be redirected to the page (where you’ll be able to represent something), you can see both methods in work here.

1st example:

Add following HTML code to your website’s code:

<select id=”Select” name=”Select”>
<option>option1</option>
<option>option2</option>
<option>option3</option>
<option>option4</option>
<option>option5</option>
</select>

2nd example:

<script language=”JavaScript”>
<!–
function goToURL(form)
{
var myindex=form.dropdownmenu.selectedIndex
if(!myindex==””)
{
window.location.href=form.dropdownmenu.options[myindex].value;
}
}
//–>
</script>
<form name=”form1″>
<select name=”dropdownmenu” size=1 onChange=”goToURL(this.form)”>
<option selected value=””>choose your favorite search engine</option>
<option value=”http://google.com”>Google</option>
<option value=”http://msn.com”>MSN</option>
<option value=”http://yahoo.com”>YAHOO</option>
<option value=”http://aim.com”>AIM</option>
</select></form>

Posted By: lvlind
Last Edit: 06 Oct 2016 @ 04:17 PM

EmailPermalink
Tags
Tags:
Categories: How to?


 

Responses to this post » (None)

 
Post a Comment

You must be logged in to post a comment.


 Last 50 Posts
Change Theme...
  • Users » 1
  • Posts/Pages » 34
  • Comments » 0
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About



    No Child Pages.

Need Help?



    No Child Pages.

Check your IP



    No Child Pages.