简体   繁体   中英

Open page with html form and then pre-fill it

I would like to create a .html file with a link to gmail.com. When clicking the link, I would like to have my email address automatically filled in as the undermake. I would like to use JavaScript for this. That is, I would like to insert text from a JavaScript variable.

I noticed on the source code for the login page for Gmail that there is the following:

<label for="Email"><strong class="email-label">Username</strong></label> 
<input type="email" spellcheck="false"  
name="Email" id="Email" value=""
>

So, I guess that, my question is : how can I give a value to Email in this form on the gmail login page?

It looks like you can specify an email address in the URL for gmail:

https://accounts.google.com/ServiceLoginAuth?Email=email@example.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM