<input id="inp">
<div id='parent'>
<div>
<div>abc</div>
<div>a</div>
<div>b</div>
</div>
<div>
<div>c</div>
<div>d</div>
</div>
</div>
<script>
window.onload = function() {//onload begin
var inp = document.getElementById('inp');
var find = function() {//find begin
var parent = document.getElementById('parent');
var divs = parent.getElementsByTagName('div');
len = divs.length;
for (var i = 0; i < len; i++) {//for begin
if (divs[i].childNodes.length == 1 && inp.value != divs[i].innerHTML && inp.value != '') {
divs[i].style.display = 'none';
} else if (divs[i].style.display != 'block') {
divs[i].style.display = 'block';
}
}//for end
}//find end
inp.onkeyup = function() {
find();
}
}//onload end
</script>