我有一个input
和一个ul
有很多li
这样的:
输入
<input type="text" placeholder="searching friends ..." id="search-friends">
这是我的朋友列表:
<ul id="friend-list">
<li class="on" id="1" conversation="">
<button class="conver-link">
<div class="friend-detail">
<div class="friend-name"> <span>Janatan</span>
</div>
</div>
</button>
</li>
<li class="on" id="2" conversation="">
<button class="conver-link">
<div class="friend-detail">
<div class="friend-name"> <span>andy</span>
</div>
</div>
</button>
</li>
<li class="bs" id="3" conversation="">
<button class="conver-link">
<div class="friend-detail">
<div class="friend-name"> <span>Anna</span>
</div>
</div>
</button>
</li>
<li class="bs" id="4" conversation="">
<button class="conver-link">
<div class="friend-detail">
<div class="friend-name"> <span>fred</span>
</div>
</div>
</button>
</li>
<li class="bs" id="5" conversation="">
<button class="conver-link">
<div class="friend-detail">
<div class="friend-name"> <span>john</span>
</div>
</div>
</button>
</li>
<li class="of" id="6" conversation="">
<button class="conver-link">
<div class="friend-detail">
<div class="friend-name"> <span>cristian</span>
</div>
</div>
</button>
</li>
</ul>
我想在键入任何单词时隐藏ul
并向我显示相关的li,就像键入名称一样.....