"angular js validation"
Bootstrap 3.0.0 Snippet by sachinkul6185@gmail.com

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <style> .ng-scope span{display:inline} .red{color:#ff0000;font-size:50px;text-transform:uppercase;text-decoration:blink;} .bg-custom{background:#999;color:#fff;width:100%;float:left;padding:25px;} </style> </head> <body> <div ng-app="login" ng-controller="changecolor" class="bg-custom"> <p>My name is <span id="me" data-ng-bind="name || 'Don'" ></span></p> <input type="text" ng-change='hello()' id='Text1' ng-model="name" placeholder="you are wrong"> </div> <script> var app = angular.module('login', []); app.controller('changecolor', function($scope) { $scope.hello= function(){ var x=angular.element(document.getElementById('Text1')); $scope.textbox = x.val(); var bool = angular.equals($scope.textbox, 'you are wrong'); if(bool==true) { var redclass = angular.element( document.querySelector( '#me' ) ); redclass.addClass('red'); redclass.removeClass('black'); } else { var redclass = angular.element( document.querySelector( '#me' ) ); redclass.removeClass('red'); redclass.addClass('black'); } }; }); </script> <br/> <p>Note: please entre 'you are wrong' then you can see the result </p> </body> </html>
/*$(document).click(function (e) { var container = $(".outer-div"); // if the target of the click isn't the container nor a descendant of the container if (!container.is(e.target) && container.has(e.target).length === 0) { $(".mfsw_open-new").hide() } var container = $(".mfsw_calendarInput"); // if the target of the click isn't the container nor a descendant of the container if (!container.is(e.target) && container.has(e.target).length === 0) { $(".ui-datepicker").hide() } });*/

Related: See More


Questions / Comments: