lundi 7 août 2017

Having issues executing multiple javascript lines in chrome console

I have been trying to do some manipulation on webpages using javascript. So I started with the basic Google page(https://google.com).
I ran the command
document.getElementById('lst-ib').value = 'search_term';

Then after that tried running
document.getElementsByName('btnI')[0].click(); which is the I'm feeling Lucky button.

It is showing undefined on doing so.

But when I try only click on the I'm Feeling Lucky button without changing the content of the search bar, it works.

The target is to click the Search Button, it is also not working. So I used the I'm Feeling Lucky button for testing to see if anything can be clicked.

The Same is happening in YouTube search bar as well

Any help or guidance would be much appreciated. Also please note that I am N00b and trying to learn as I go :(

Aucun commentaire:

Enregistrer un commentaire