Mrow
Mrow

Reputation: 115

div vision toggle from drop down menu

I'm creating a universal text template tool for work and I need a little help with getting the appropriate template to show up when a drop down menu is changed.

I'm using JavaScript, no JQuery for me yet.

The template objects are divs, and they are supposed to change by setting display: none on all but the one the menu has selected.

The problem: The templates (divs) never change.

Fiddle

Thank you for looking!

Upvotes: 0

Views: 94

Answers (1)

Arun P Johny
Arun P Johny

Reputation: 388316

There are multiple problems with the script.

Problems
1. caseSelect was pointing to the object instead of value (var caseSelect = document.getElementById("caseType").value;)
2. In the select element all options had the value thing1
3. break statement was missing at the end of each case

Demo: Fiddle

Upvotes: 1

Related Questions