value="" に基づいて選択ドロップダウンで div を表示および非表示にしようとしています。
なぜこれが機能しないのか、誰かが私に説明してもらえますか? これがJfiddleです:http://jsfiddle.net/JNyce/11/
$('.section_container').children().hide();
$('#form_selection').change(function() {
var selection = $(this).parent().find("option:selected").text();
var newselection = selection.split(' ').join('_');
$('.section_container'+newselection).show();
});
html
<div class="box" style="border: 1px solid black; margin-top:100px;">
<select id="form_selection">
<option value="Program 1">Program 1</option>
<option value="Program 1">Program 2</option>
</select>
<div class="section_container">
<div class="Program_1" style="height:200px; border:1px solid black">
<div class="title">Testing</div>
<span> orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing</span>
<div class="section_logo" style="width:100px; height:100px; float:left;"><img src="http://www.dublin.k12.ca.us/cms/lib5/CA01001424/Centricity/Domain/35/homeschool.jpg"> </div><button class="blue-pill" style="float:right;">Select Program</button>
</div>
<div class="Program_2" style="height:200px; border:1px solid black">
<div class="title">Testing</div>
<span>orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing </span>
<div class="section_logo" style="width:100px; height:100px; float:left;"><img src="http://www.dublin.k12.ca.us/cms/lib5/CA01001424/Centricity/Domain/35/homeschool.jpg"> </div>
<button class="blue-pill" style="float:right;">Select Program</button>
</div>
</div>