How to change the color of the button in green if the user enters an exact value?

Published

The user should enter 7 figures in the input, then the user enters 7 figures, the button should becomes green. I don’t know if it’s possible to make it in Angular?

I don’t see how to transform the button in green ?

Here is my code below

<input type="text" class="inputSignInAccess" [(ngModel)]="otp" >
    <div class="error" style="color: red;">
      <div *ngIf="otp?.length > 7 ">
          You need 7 digits
      </div>
     

        <div *ngIf="otp.length != 0 && otp?.length < 7 ">
              You need 7 digits
         </div>
             
    </div>

    <div class="inputButtons ">
    <button>ok</button>
  </div>

The code is also on Stackblitz

Source: Angular Questions

Published
Categorized as angular Tagged

Answers

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq