Created
August 16, 2011 16:07
-
-
Save jhuttner/1149435 to your computer and use it in GitHub Desktop.
jquery demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select id="sel1"> | |
<option>Eric</option> | |
<option>Joe</option> | |
</select> | |
<p id="eric" class="hidden">Hi, I'm eric</p> | |
<p id="joe" class="hidden">Hi, I'm joe</p> | |
$(document).ready(function(){ | |
$("#sel1").change(function() { | |
var value = $(this).val(); | |
if (value == "eric") { | |
$("#eric").removeClass('hidden'); | |
$("#joe").addClass('hidden'); | |
} else if { | |
// same but switched | |
} | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment