Which of the following validations is expected from the given JavaScript function?
Which of the following validations is expected from the given JavaScript function?
दिए गए जावास्क्रिप्ट फंक्शन से निम्नलिखित में सेकौन-सा सत्यापन अपेक्षित है?
<script>
function validateemail ()
{
var x = document.theform.email.value;
var attheposition-x.indexOf (“@”);
var dotposition-x.lastIndexOf(“.”);
if
(attheposition<1||dotposition<attheposition+2||
dotposition+2>=x.length) {alert (“Please enter
a valid e-mail address “);
return false;
}
}
</script>
<body
= <form name “theform” method=”post” action = “#” onsubmit=”return validateemail (0);”> Email: <input type = “text” name = “email”><br/>
<input type=”submit” value = “register”> </form>