Here is an easy way to do it in JQuery.
This uses a filtering of text data inside of a table via a data-filter on the table row, but it can easily be used for other purposes.
$('#search').on('keyup', function() {
var val = $.trim(this.value);
if (val) {
$('tr[data-filter!=' + val + ']').hide();
$('tr[data-filter^=' + val + ']').show();
} else {
$('tr[data-filter]').show();
}
});
In this example it will hide all table rows where an exact match wasn't found, and then filter by the start of the string value. The trim() function is useful in case all that's there is empty spaces, then it will still display everything as if a search was never made. If you want it to display the searched input where it's anywhere on the string, use a * instead of a ^. Both special characters are case sensitive. Also be sure that the hide command displays first and that both are present, or it won't work properly.
See another example here that utilizes both the ^ and * characters:
http://jsfiddle.net/heatwaveo8/2VKae/