在iPhone / iPad Safari键盘上显示“搜索”按钮 [英] Show 'Search' button in iPhone/iPad Safari keyboard

查看:497
本文介绍了在iPhone / iPad Safari键盘上显示“搜索”按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到在戴尔或谷歌等网站上进行导航,在iPhone上输入他们的搜索文本框,在键盘上出现一个蓝色按钮搜索,而不是标准的开始按钮,出现在任何标准格式中。



您应该如何显示搜索按钮? 您可以通过以下方式影响此行为:

 < input type =search/> 

JS Bin演示



忽略提交按钮的文字为'水壶',我只是想以确保它不是影响iOS键盘文本的提交按钮......



这当然是向后兼容的,因为浏览器不支持理解 type =search会默认为 type =text,这对创建向前规划HTML5表单


I've noticed navigating in websites like Dell or Google, that typing in their search text box with iPhone, in the keyboard appears a blue button 'Search' instead of the standard 'Go' button that appears on any normal form.

What should you do to display the search button?

解决方案

You can influence this behaviour with:

<input type="search" />

JS Bin demo

Ignore the submit button's text being 'kettle,' I just wanted to be sure that it wasn't the submit button influencing the text of the iOS keyboard...

This is, of course, backwards compatible since a browser that doesn't understand type="search" will default to type="text", which is useful for creating forward-planning html5 forms.

这篇关于在iPhone / iPad Safari键盘上显示“搜索”按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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