1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to show second div on 1st div click and first div on second click?

Discussão em 'Angular' iniciado por user7030651, Julho 22, 2025.

  1. user7030651

    user7030651 Guest

    I have 2 divs. I want to show 2nd div on 1st div click and show 1st div on 2nd div click. By default , 1st div should be shown.


    backClick:boolean ;

    ngOnInit() {
    this.backClick = true;
    }

    <div *ngIf="backclick==true">
    <span (click)="help_screen=true">Click</span>
    </div>

    <div *ngIf="help_screen==true">
    <span (click) = "backclick=true">Back</span>
    </div>

    Continue reading...

Compartilhe esta Página