Home > Web Front-end > HTML Tutorial > H5 input type="search" 不显示搜索 解决方法_html/css_WEB-ITnose

H5 input type="search" 不显示搜索 解决方法_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-24 11:37:35
Original
1241 people have browsed it

在IOS(ipad iPhone等)系统的浏览器里打开H5页面。如下写法:

<input type="search" name="search” id="search">
Copy after login

以上设备的键盘仍然显示“换行”。

解决方法如下:在input外面嵌套一层form:

<form action="">    <input type="search" name="search" id="search"></form>
Copy after login

 

其中form 必须有action。

如果你不想要action,因为它可能影响了你input的提交逻辑,可以重写一下onsubmit onclick等方法来实现。

也可以用简单的方法:action="javascript:return true;"。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template