< input type =" search">不适用于iPhone Mobile Safari [英] <input type="search"> not working on iPhone Mobile Safari

查看:149
本文介绍了< input type =" search">不适用于iPhone Mobile Safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据说在Safari的HTML5中,您可以将输入类型定义为搜索,当用户开始输入时,会出现一个X按钮以允许它们清除,就像Safari中的Google搜索栏一样。在我的网站上,这适用于桌面Safari,但它在Mobile Safari中不起作用。

Supposedly in HTML5 in Safari, you can define your input type as "search" and when the user starts typing, an X button will show up to allow them to clear, much like the Google search bar in Safari. On my website, this works on desktop Safari but it doesn't work in Mobile Safari.

    <input id="termsField" type="search" autocorrect="off" placeholder="Type something here">

//This is the code for the X button I have to use now since HTML5 doesn't work
<INPUT type="image" name="Clear" alt="Clear" src="clearX.png" height="22" width="22"
        onClick="clearText(this)">

起初我以为是因为我在上有一个Jquery自动完成功能# termsField 但是如果它在桌面浏览器中工作则不会是这种情况。有谁知道为什么会发生这种情况?
此外,它在我的iPhone或XCode的iPhone模拟器中都不起作用,所以这不是我的iPhone特有的问题。

At first I thought it's because I have a Jquery autocomplete function on the #termsField but again if it works in Desktop Safari that wouldn't be the case. Does anyone have any idea why this might be happening? Also, it doesn't work either on my iPhone or in the iPhone Simulator in XCode so it's not an issue specifically with my iPhone.

推荐答案

适用于(桌面)Safari,但不适用于iPhone(Mobile Safari)。你可以通过一些聪明的人来模仿功能 javascript。

That works in (Desktop) Safari, but not on the iPhone (Mobile Safari). You can mimic the functionality via some clever javascript.

这篇关于&lt; input type =&quot; search&quot;&gt;不适用于iPhone Mobile Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆