I would like to write a small script that upon running it should fill some data in a html site that are already given. So for example lets say the site is the stackoverflow logn page and I need to fill my username and password.
Knowing that for the username we have:
<input type="email" name="email" id="email" size="30" maxlength="100" placeholder="[email protected]">
password:
<input type="password" name="password" id="password" placeholder="********">
and data:
data = {username:"user", password:"pass"};
our js should be something like below (correct?):
document.getElementById("email").value=data.username;
document.getElementById("password").value=data.password;
What I dont really understand is how to "post" that into the site and then hit the login button.(ajax?) Generally how to bring it together and make it a running script.
Thanks in advance.
document.getElementById("myForm").submit();
having embedded you input filed in an HTML form with id="myForm"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With