How to get an email name in JavaScript

How do I get someone’s name in JavaScript? For example, when you get a glitch email from a forum it says [username] via Glitch Support but the email is glitch@discoursemail.com . So how do I get someone’s name?

Are you asking how to strip “via glitch support” from the email?

Yes, I am trying to do that

Try using .replace(" via Glitch Support", "") on subject field string.

That was an example and I meant like how do I get someone’s email name

These days it’s pretty convenient. Add this

<p><label>I want to know your email address!<br>
<input id="emailinput" type="email"></label></p>
<p><label>And your name!<br>
<input id="nameinput"></label></p>
<p>See our <a href="privacy.html">privacy policy</a>.</p>

Then after they put it in, do this

document.getElementById('emailinput').value

to get the email, and do this

document.getElementById('nameinput').value

to get the name

1 Like