I want to validate an email validation of type 'abc@xyz.com.com'
Should show an error message if they enter invalid domain name.
Would be very grateful for your help.
If this is just for learning, you can also use the email input type in HTML5 which validates it. If you are doing this just through HTML4 and JavaScript look at using Regex. The example above is terrible.
Should show an error message if they enter invalid domain name.
How far do you want to take this? For example, what jwmollman posted does not allow .museum. It does allow .xx which is not a valid extension (yet). I advise to fully read the second linke stbuchok provided. What about arabic domains?