<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<style>
input.ng-invalid {
    background-color: lightblue;
}
</style>
<body>

<form ng-app="" name="myForm">
    Enter your name:
    <input name="myName" ng-model="myText" required>
</form>

<p>Edit the text field and it will get/lose classes according to the status.</p>
<p><b>Note:</b> A text field with the "required" attribute is not valid when it is empty.</p>

</body>
</html>
// Code goes here

/* Styles go here */

<div>
w3s112-AngularJS Model CSS Classes
<br/>
code example:
  <hr>
index.html
  <br/>
  <textarea 
  id='codeoutput' 
  style="width: 100%;height: 300px;background-color: #dffff4;
      font-size: 1em;font-family: Verdana, Arial, Helvetica, sans-serif;
      border: 1px solid black;">
      
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<style>
input.ng-invalid {
    background-color: lightblue;
}
</style>
<body>

<form ng-app="" name="myForm">
    Enter your name:
    <input name="myName" ng-model="myText" required>
</form>

<p>Edit the text field and it will get/lose classes according to the status.</p>
<p><b>Note:</b> A text field with the "required" attribute is not valid when it is empty.</p>

</body>
</html>

    
  </textarea>

  
  <hr/>
  <iframe 
  allowfullscren="allowfullscren" 
  frameborder="0" 
  src="https://embed.plnkr.co/KTCGjkhiPULYvi6Q6uFN?show=preview" 
  style="height: 400px; width: 100%;">
  </iframe>
  <hr> 
https://www.w3schools.com/angular/angular_model.asp
  <hr> 
  201603
</div>