Tuesday 15 January 2013

google chrome - How do I put a string into a textbox (username box) using javascript? -



google chrome - How do I put a string into a textbox (username box) using javascript? -

this question has reply here:

how set value of text field through tampermonkey? 1 reply

i using tampermonkey on chrome , running on website. trying log in using login credentials. got click log out, not log in. here's whole code:

// ==userscript== // @name blah // @namespace blah.com // @description . // @include http://blah.com/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js // ==/userscript== //function logout() //{ // log out of blah // blah = document.getelementsbyname(“blah"); // in 1..2 // log in // //username = username1 // password = password1 // { // { // greybuttons.click(); // } // } //} function logout() { // log out of blah incase signed in document.getelementbyid('blah').click(); } logout(); function login() { document.getelementbyid("header_login_tbusername") //i don't know set here } login();

document.getelementbyid('username').value = 'mylogin'; document.getelementbyid('password').value = password; // don't care how document.getelementbyid('loginbutton').click();

also, why require jquery if you're going go pure js?

javascript google-chrome login tampermonkey

No comments:

Post a Comment