Run ❯
Get your
own
website
Result Size:
625 x 565
❯
Run Code
Ctrl+Alt+R
Save Code
Ctrl+Alt+A
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
<!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script> <body ng-app=""> <p>Try leaving the first input field blank:</p> <form name="myForm"> <p>Name: <input name="myName" ng-model="myName" required> <span ng-show="myForm.myName.$touched && myForm.myName.$invalid">The name is required.</span> </p> <p>Address: <input name="myAddress" ng-model="myAddress" required> </p> </form> <p>We use the ng-show directive to only show the error message if the field has been touched AND is empty.</p> </body> </html>