TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How to Use ng-valid and ng-invalid in AngularJS
Ajay Malik
Aug 01
2016
Code
823
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
!DOCTYPE html
>
<
html
>
<
script
src
=
"http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"
>
</
script
>
<
body
ng-app
>
<
style
>
input.ng-invalid {
background-color:red;
}
input.ng-valid {
background-color:lightgreen;
}
</
style
>
<
h3
>
enter a email:
</
h3
>
<
form
name
=
"myform"
>
<
input
type
=
"email"
name
=
"myinput"
ng-model
=
"myvalue"
>
</
form
>
</
body
>
</
html
>
AngularJs