Drop Down List

Discussion in 'Web Design and Development' started by amtjb, Jan 23, 2015.

  1. amtjb, Jan 23, 2015
    Last edited by a moderator: Jan 23, 2015

    amtjb macrumors member

    Jan 5, 2011
    Will someone please tell me how to make my drop down list link to different url?

    <!DOCTYPE html>
    <html lang=“en”>
         <meta charset=“utf-8”/> 
         <link rel=“stylesheet” href=“style.css” />
    <label for="Websites">Websites:</label>
    <select id="Websites" name="Websites">
                    <option value="Google">Google</option>
                    <option value="Facebook">Facebook</option>
                    <option value="Twitter">Twitter</option>
                    <option value="Pinterest">Pinterest</option>
  2. Darth.Titan macrumors 68030


    Oct 31, 2007
    Austin, TX
    We're gonna need just a bit more info if you want any help.

    What exactly are you trying to accomplish?
  3. amtjb thread starter macrumors member

    Jan 5, 2011
    Drop down list

    I want to be able to go to main menu. Click on main menu to go to web page on my website that has drop down list. Once on page that has drop down list. Have information telling person that they must make a selection from drop down list to go to desired web site.
  4. 960design macrumors 68030

    Apr 17, 2012
    Destin, FL
    You are misusing form field elements, which is why you are having difficulty. List elements would be more appropriate ( <ul> or <ol> ). A little javascript will make it work.
    <select id="websites" name="websites">
    <option value="http://www.google.com">Google</option>
    <option value="http://www.facebook.com">Facebook</option>
    <option value="http://www.twitter.com">Twitter</option>
    <option value="http://www.pinterest.com">Pinterest</option>
    <script type="text/javascript">
     var urlmenu = document.getElementById( 'websites' );
     urlmenu.onchange = function() {
          window.open( this.options[ this.selectedIndex ].value );
  5. amtjb thread starter macrumors member

    Jan 5, 2011
    Drop down list

    Thanks for the help a million. That is exactly what I was trying to figure how to do.

Share This Page