Skip to content

Instantly share code, notes, and snippets.

@jhuttner
Created August 16, 2011 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhuttner/1149435 to your computer and use it in GitHub Desktop.
Save jhuttner/1149435 to your computer and use it in GitHub Desktop.
jquery demo
<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