javascript - Drop down menu to display content below it once a list item is selected, best way to do it? -


i need create simple dropdown menu combined text box (example 100px below it) should show info related choice when selected. i'm thinking displaying info in simple text, customize css. achieve result should create different classes/variables in javascript or there way html , css? (or there better way this?) have no idea how start this. suppose i'll have study lot of javascript in end, if aware of resources, please, link nice tutorial appreciated!

my knowledge of javascript basic if not on zero.

thank help.

i tried got question correct me if understood else.

you can write html like

<select id="opt">     <option> no 1</option>     <option> no 2</option>     <option> no 3</option> </select> <input type="text" id="info" value="no1 info"/> 

and using jquery can value user selected , according display information.

$("#opt").change(function(){     var choice=$(this).val();    $("#info").val(info(choice)); })  var info=function(choice){      var iz ;      switch(choice){      case "no 1":iz="no1 info";      break;      case "no 2":iz="no2 info"      break;      case "no 3":iz="no3 info"      break;      }       return(iz);    } 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -