Skip to content Skip to sidebar Skip to footer

How To Show/hide Button?

I'm making an app with a dynamic page. I have multiple buttons on my page but all buttons should not be visible at once rather visible one after another in consecutive. I need them

Solution 1:

I've been working on an application that shows and hides div elements. Hope you can you proceed with the following example.

<divclass="container"ng-app="showHideApp"ng-controller="showHideController"><divclass="col-sm-8 col-sm-offset-2"><!-- FORM --><divclass="form-group"><buttonclass="btn btn-danger"ng-click="showMe();">Click me for show</button><buttonclass="btn btn-danger"ng-click="hideMe();">Click me for hide</button></div><divclass="form-group"ng-show="show"><p>I am showing</p></div></div></div>

JS Code:

angular.module('showHideApp',[]).controller('showHideController', function($scope){
       $scope.showMe = function(){
         $scope.show=true;
       }
       $scope.hideMe = function(){
         $scope.show=false;
       }
   });

Post a Comment for "How To Show/hide Button?"