类型为search的input及相关属性

作者:aoao 来源:样式之美 时间:2009-02-11 12:49:00 

其实在很久很久之前就发现search类型的input,该属性值是WebKit私有,不过一直没去查相关的属性,介于XXX原因,我找出其属性,回头考虑在其他浏览器上也实现这样的效果。表扬一下Yupoo,他们上次改版就使用上介个。

如果你使用的是Safari(iphone上的不一样,不过会Go按钮会变成Search)或者是其他WebKit引擎的浏览器的话,你就可以看出下面这个input与其他的不同了。

看不到的朋友可以看一下图片:

看一下相关的代码:

<input type="search" placeholder="测试搜索" autosave="aoao.org.cn" results="8" >

相关的说明,就几个属性的介绍,比较简单,没有译了中文,大家看看就是,其实不用看也要以猜得出。

The incremental attribute can be used to control whether or not the search is performed as you type.

The placeholder attribute can be used to set the greyed placeholder text in the control.

The autosave attribute allows you to specify an autosave name for your search results in the dropdown. What’s cool about the autosave is that it’s global, which means that two Web sites could put up a search field with an autosave name of google and then they would share the search results. (Since the actual result values are not accessible to the page there is no privacy violation.)

The results attribute allows you to specify how many results should be displayed in the dropdown.

The search DOM event fires at the precise time the search should be performed and obeys the heuristic for the control, so you don’t have to trap key and click events at all. You can use the onsearch attribute on the control to respond when the search happens.

BTW:CSS Naked Day差不多到了,今年改在9号,有兴趣的朋友凑凑热闹。

标签:input,search,按钮,属性,浏览器
0
投稿

猜你喜欢

  • python2.x实现人民币转大写人民币

    2023-06-26 10:35:53
  • vue3 自定义指令详情

    2024-05-09 15:08:31
  • css样式表实现首写字母大写

    2007-10-08 12:11:00
  • python引入requests报错could not be resolved解决方案

    2022-08-28 08:24:45
  • Python Ajax爬虫案例分享

    2023-09-01 19:24:35
  • Oracle 正则表达式实例详解

    2024-01-25 23:43:01
  • ie和火狐兼容问题

    2010-07-02 12:50:00
  • ACCESS数据库遇日文时内存溢出的最简单处理办法

    2009-07-09 14:04:00
  • Python运算符重载用法实例

    2022-11-02 11:33:20
  • 浅析is_writable的php实现

    2023-09-09 01:41:05
  • Sql Server表死锁的解决方法分享

    2011-09-01 19:08:00
  • php逐行读取txt文件写入数组的方法 <font color=red>原创</font>

    2023-11-14 17:22:07
  • Python enumerate遍历数组示例应用

    2023-06-10 16:59:26
  • SQL Server数据库的三种创建方法汇总

    2024-01-19 01:20:24
  • 如何用Python绘制3D柱形图

    2022-12-19 04:22:04
  • 使用Python的Flask框架来搭建第一个Web应用程序

    2022-12-11 21:46:10
  • Vue 解决多级动态面包屑导航的问题

    2024-05-02 17:11:19
  • win10下mysql 8.0.12 安装及环境变量配置教程

    2024-01-19 22:34:17
  • Python实战项目刮刮乐的实现详解流程

    2021-12-01 23:19:40
  • PHP中动态显示签名和ip原理

    2024-05-11 10:12:33
  • asp之家 网络编程 m.aspxhome.com