I have the following code. What I’m trying to do is to show a div named “uploader” when “Yes” is selected in the dropdown. It’s currently not working.
$(document).ready(function() {
$("#uploader").hide();
$("#CitedIn").change(function() {
if (("#CitedIn").val() == 'yes')
$("#uploader").show("fast");
else $("#uploader").hide("fast");
});
});
<table>
<tr><td>Need item(s)?</td><td>
<select id="CitedIn" name="CitedIn" size="1" tabindex="13">
<option value="none">(Select One)</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</td></tr>
</table>
<div id="uploader">
Something...
</div>
What can done to make it work as intended?
String comparison in javascript is case sensitive, you are comparing
Yestoyes.Besides, you are missing the
$call on this lineAs it should be:
Check here: http://jsfiddle.net/Lpg2k/