var $ = jQuery;
$("document").ready(function () {
var html = "<span id='result'>Hello</span>"
$('#searchword').after(html);
$("#searchword").each(function () {
$(this).bind('keyup', hoge(this));
});
function hoge(elm) {
var v, old = elm.value;
return function () {
if (old != (v = elm.value)) {
old = v;
str = $(this).val();
$("#result").text(str);
FilterList(str);
}
}
}
function FilterList(str) {
$('#japanfood tr').show();
var searchvalue = str;
$("input").css("background-color", "#D6D6FF");
$('#japanfood tr').each(function () {
var text = $(this).html();
if (text.indexOf("th") != -1) {
$(this).show()
}
else {
if (text.indexOf(searchvalue) == -1) {
$(this).hide();
}
}
});
}
});