105
rated 0 times
[
108]
[
3]
/ answers: 1 / hits: 134668
/ 13 Years ago, sat, may 28, 2011, 12:00:00
Is there a simple way, using JavaScript, to dynamically show/hide content in a <div>
based on the users selection from a drop down menu? For example, if a user selects option 1
then I would like <div>
1 to be displayed and all other <div>
s to be hidden.
EDIT: Example HTML
Setup
<select>
<option> Option 1</option>
<option> Option 2</option>
<option> Option 3</option>
<select>
<div id=content_1 style=display:hidden;>Content 1<div>
<div id=content_2 style=display:hidden;>Content 2<div>
<div id=content_3 style=display:hidden;>Content 3<div>
More From » jquery