First get the email address to parse. You’ve already done that. Here, x contains the email address.
var x = document.getElementById("myText").value;
Now you can use x.indexOf(".") to get the position of the first period. Likewise, use x.indexOf("@") to get the position of the “@” symbol.
These two values are passed to x.substring() to get the text between the two.
6
solved JavaScript taking information from a email address