2011年2月23日

让浏览器兼容placeholder

摘要: html5为元素添加了新属性placeholder。这是一个很常用的功能:把提示放在输入框里;onfocus时提示消息;onblur时如果已有值,则不再提示,如果没值,保留提示。QWrap的Valid组件里,提供了这个功能。不过Valid的功能太多,有使用成本。这里,把跟placeholder的功能独立出来,可以无依赖的使用。代码如下:View Code <html><head><meta http-equiv="Content-Type" content="text/html; charset=GB2312">< 阅读全文

posted @ 2011-02-23 17:33 JKisJK 阅读(9437) 评论(9) 推荐(2) 编辑

导航