<input id="filter" type="text" />
<ul id="users"></ul>
<script type="text/javascript">
var items = ["Коробкин", "Коробков", "Коробов", "Коржиков", "Корицын", "Коновалов", "Капитула", "Иванов", "Петров", "Сидоров"];
var length = items.length;
var list = document.getElementById("users");
var input = document.getElementById("filter");
function createListItems(condition) {
var result = [], i = -1, j = 0;
while (++i < length) {
if (condition ? items[i].indexOf(condition) == 0 : true) {
result[j++] = items[i];
}
}
return result.length ? "<li>" + result.join("</li><li>") + "</li>" : "";
}
(function () {
list.innerHTML = createListItems(input.value);
setTimeout(arguments.callee, 100);
}());
</script>