zoukankan      html  css  js  c++  java
  • 移动端密文弹数字键盘

    当我们开发移动端页面上的输入框,需要输入密文时,一般我们会用如下方式实现:

    当type="password"时,输入框显示为圆点密文,调起的是英文键盘

    <input type="password" placeholder="password"/>

     

    但有的时候输入的密文得是纯数字格式,这时候产品就要求我们弹出的默认输入键盘为数字键盘,这该怎么实现。

    优化方案:当type="number" 或者 type="tel" 时,想要输入框显示圆点密文,同时调起数字键盘

    <input type="tel" placeholder="tel" placeholder="tel" style="-webkit-text-security:disc;text-security:disc;"/>

    为了在移动端实现密码输入框且调起的键盘为数字键盘,可以用-webkit-text-security:disc;text-security:disc;属性来实现。

    语法: 
    text-security: circle | disc | none | square; 
    -webkit-text-security: circle | disc | none | square;

    none 无。
    circle 圆圈。
    disc 圆形。
    square 正方形。



  • 相关阅读:
    MS-DOS命令
    寻找一条通过迷宫的路径
    linux文件基本操作和常用命令
    网络基础
    计算机基础---操作系统
    GIT 使用
    计算机基础
    秒角士网站
    咖啡项目
    winfrom面向对象1
  • 原文地址:https://www.cnblogs.com/wxcbg/p/10257065.html
Copyright © 2011-2022 走看看