Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apassword

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apassword

A password ui control module.

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

apassword


NPM version spm package Build Status Coverage Status

移动端密码控件。

snipshot


使用说明

  • maxlength 定义了密码长度,默认长度为 6。
  • 为了表单校验,建议同时设置 minlength
  • 可以通过 pattermtype 属性控制键盘响应。
<input type="password" class="apassword"
    pattern="\d*"
    minlength="6" maxlength="6" />
var APassword = require('apassword');

new APassword("input.apassword")
  .on("complete", function(value){

    alert(value);

}).render();
</script>

API

val()

获取密码。

clear()

清空密码。

focus()

让密码控件获得焦点,该行为会激活显示键盘。

blur()

让密码控件失去焦点,该行为会隐藏键盘。

Events

complete

指定位数的密码输入完成时,触发 complete 事件。

focus

密码控件活动焦点时触发 focus 事件。

blur

密码控件失去焦点时触发 blur 事件。

参考

Keywords

FAQs

Package last updated on 17 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc