Jon Smith Jon Smith - 1 year ago 89
HTML Question

form display items php

I'm trying to create a website that has a drop down menu which is coded like:

<select name="languages">
<option value"html">HTML</option>
<option value"css">CSS</option>
<option value"js">JavaScript</option>
<option value"csharp">C#</option>
<option value"php">PHP</option>
<option value"java">Java</option>
<option value"phython">Phython</option>
<input type="Submit">

And in an ideal world, I'd want the relevent information to be displayed on the same page as the drop down menu. So when a user selects the
option, all the information for that will be displayed on the page, then if they choose the
option, the
information will be cleared and the
information will be loaded in.

Answer Source

I have added some Jquery and CSS to your codes. Besides you forgot "=" in your value field. The solution is to get the value from select and use it to decide which Id has to be shown. Please run the code snippet and see the result.

var id;
<script src=""></script>
  <select name="languages" id="languages">
    <option value="html">HTML</option>
    <option value="css">CSS</option>
    <option value="js">JavaScript</option>
    <option value="csharp">C#</option>
    <option value="php">PHP</option>
    <option value="java">Java</option>
    <option value="phython">Phython</option>

<div class="section" id="html">html content here</div>
<div class="section" id="css">CSS content here</div>
<div class="section" id="js">js content here</div>
<div class="section" id="csharp">csharp content here</div>
<div class="section" id="php">php content here</div>
<div class="section" id="java">java content here</div>
<div class="section" id="phython">phython content here</div>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download