假設在Safari中的HTML5中,您可以將輸入類型定義爲「搜索」,當用戶開始輸入時,X按鈕將顯示出來,很明顯,很像Safari中的Google搜索欄。在我的網站上,這適用於桌面Safari,但在Mobile Safari中不起作用。<input type =「search」>不適用於iPhone 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)">
起初我還以爲這是因爲我對#termsField
jQuery的自動完成功能,但同樣,如果它在桌面Safari瀏覽器的工作原理,不會是這樣的。有誰知道爲什麼會發生這種情況? 另外,它不能在我的iPhone或XCode的iPhone模擬器中工作,所以它不是特別針對我的iPhone的問題。
在iPad上不適用於我 – Shamoon 2013-09-04 14:50:46