bleykFaust bleykFaust - 2 months ago 7
AngularJS Question

Show another Div when I clicked the button on the Previous Div

I have two in my html file. The first contains a button that when I click should show the other div and would hide the first one My code is something like this:

<div class="container" ng-hide="showme">
<p>Quick</p>
<button class="button" ng-click="showme=true" >Edit</button>
</div>
<div class="container" ng-show="showme">
<p>Congratulations!</p>
</div>


How can I possibly do that? Thaks for any help. It is greatly appreciated.

Answer

It's easier with jquery just write

    $(document).ready(function(){
        $("#Button-id").click(function(){
            $(this).parent().css("display","none");
            $(this).parent().next().css("display","block");
        });
    });

https://jsfiddle.net/sy1x1xm9/

Comments