I have a simple JavaScript question. I want a drop down selection so that when you select a certain option is shows the value of the option in a div. So for example:

<option value="select-1">One</option>
<option value="select-2">Two</option>
<option value="select-3">Three</option>

So lets say that option one is selected, then in a div somewhere else on the page "select-1" (the value of option one) would show up in that div. Same thing with all the other options. I will have a bunch of these on one page.

Does anyone know how to do this? Thanks!

well .. you can give your div's (or labels) id's, and triggered by the onchange of your selectbox, get that element (by the id) and set it's innerText, innerHTML,...

That should get you started, I guess.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.