We can display or hide the div element on the basis of value of isShow variable.

<!DOCTYPE html> <html xmlns=""> <head> <title>Welcome to LearnKode - A code learning platform</title> <script src=""></script> </head> <body ng-app=""> <form name="form"> <div ng-hide="isShow"> User Name <input type="text" required ng-model="userName" /><br /><br /> Password <input type="password" required ng-model="password" /><br /><br /> <input type="button" ng-disabled="form.$invalid" ng-click="isShow = true" value="Login" /> </div> <div ng-show="isShow"> Successfully Login.<br /> <input type="button" ng-click="isShow = false;password='';userName=''" value="Logout" /> </div> </form> </body> </html>