JavaScript

超轻量级php框架startmvc

AngularJS实时获取并显示密码的方法

更新时间:2020-06-27 00:00 作者:startmvc
本文实例讲述了AngularJS实时获取并显示密码的方法。分享给大家供大家参考,具体如下:1

本文实例讲述了AngularJS实时获取并显示密码的方法。分享给大家供大家参考,具体如下:

1、设计源码


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>www.jb51.net - AngularJS获取密码</title>
<script type="text/javascript" src="angular.min.js"></script>
</head>
<body>
 <div ng-app="">
 <p>密码:<input type="password" ng-model="password" maxlength="12"></p>
 <p ng-bind="password"></p>
 </div>
</body>
</html>

2、实现结果

3、实例说明

当输入框中输入“123456”,下面也跟着显示“123456”;绑定式显示