finding difficulties in result. unable to retrieve email part and domain partof the mail id.
<!DOCTYPE html> <html> <head> <title>indexing</title> <script type="text/javascript"> function getEmailAndDomainParts() var emailAddress = document.getElementById("myemail").value; var emailPart = emailAddress.substring(0, emailAddress.indexOf("@")); var domainPart= emailAddress.substring(emailAddress.indexOf("@")); document.getElementById("emailparty").value = emailPart; document.getElementById("domainpartx").value = domainPart; </script> </head> <body> <form> <table style="border: 1px solid black; font-family: Arial"> <tr> <td> email adress </td> <td> <label></label> <input type="text"; id="myemail"; value="enter email id"/><br> </td> </tr> <tr> <td> email part </td> <td> <label> </label> <input type="text"; name="emailparty"; id="mailpa"><br> </td> </tr> <tr> <td>domian part</td> <td> <label></label> <input type="text"; id="domainpartx"; value=""/><br> </td> </tr> <tr> <td> </td> <td> <input type="button"; onclick="getEmailAndDomainParts()" value="get email and domain part" ; style="width: 200px" background-color="red";> </td> </tr> </table> </form> </body> </html>