Ng-Blur-3

 

Example of Ng-Blur

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> </head> <body ng-app="app"> <div class="container"> <div ng-controller="LearnKode"> User Name: <input class="form-control" type="text" ng-blur="userName=false" ng-focus="userName=true"> <span style="color:red" ng-show="userName">Input your User name</span><br /> Password: <input class="form-control" type="text" ng-blur="password=false" ng-focus="password=true"> <span style="color:red" ng-hide="!password">Input your Password</span> </div> </div> <script> var app = angular.module("app", []); app.controller('LearnKode', ['$scope', function ($scope) { }]); </script> </body> </html>
Output