如何在一个input框后面添加一个x,用来清除输入框的信息? 2022年2月9日 zhufenghua 留下评论 在 html5 中,input 标签中的 type 新增属性值为 search,使用该属性时浏览器默认会给input一个清除输入框 这也意味着,用作搜索时,input 的属性应该是 search 而不是 text <html> <body> <input type="search" placeholder="搜索" > </body> </html>