I would like to write a small script that at startup should fill in some data on the html site that is already specified. So, for example, let's say that the site is a stackoverflow logover page , and I need to fill in my username and password.
Knowing that for the username we have:
<input type="email" name="email" id="email" size="30" maxlength="100" placeholder="you@example.org">
Password:
<input type="password" name="password" id="password" placeholder="********">
and data:
data = {username:"user", password:"pass"};
our js should be something like below (right?):
document.getElementById("email").value=data.username;
document.getElementById("password").value=data.password;
What I really do not understand is how to "send" to the site, and then click the login button. (ajax?) Typically, how to assemble it and make it a running script.
Thanks in advance.
source
share