百度搜索框看似简单,但是涉及到了数据交互,如果能用vue来实现的话会简单很多,现在用jq模仿了一下,写的代码不是一般的多啊!
当然头部要引入jq了
html部分
<input type="text" id="txt" />
<input type="button" id="btn" value="百度一下"/>
<div class="box" id="box">
<ul>
</ul>
</div>
css部分
ul,li{
list-style: none;
margin: 0;
padding: 0;
}
li{
line-height:30px;