my code is below both are in diffrent pages
<tr>
  <td width="100">email:</td><td width="100"><input type="email" name="mailid" id="mail" onKeyUp="validateemail()" required></td><td><label id="vem"></label></td>
</tr>
JS
function validateemail() {
    var chmail=document.getElementById("mail");
    if(chmail.match(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/))
    {
        producePrompt("valid email","vem","green"); 
        return false;
    }
    producePrompt("email invalid","vem","red"); 
        return true;
}
 
     
    