Skip to content

Instantly share code, notes, and snippets.

Created July 24, 2010 11:00
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 anonymous/488611 to your computer and use it in GitHub Desktop.
Save anonymous/488611 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="jquery-1.4.2.min.js"></script>
<script>
$(document).ready(function() {
$('#inputId').bind('keyup', function() {
$('#divs div').hide();
var divName = this.value;
if(divName) {
$('#divs #' + divName).show();
}
});
});
</script>
</head>
<body>
<input type="text" id="inputId">
<div id="divs">
<div id="cool">Cool</div>
<div id="neat">Neat</div>
<div id="suck">Suck</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment