Monday, 15 March 2010

javascript - Clicking on an element with JQuery -


I'm trying to use Jquery (actually the first time) to click on a photo on Google Images Search page () I do the following:

  all images = $ (".rg_di"); Picture = all images [0]; Picture.click ();   

I hope I click this picture, but it does not do anything.

What am I doing wrong? Thank you.

It looks like you're searching for the wrong class name for Google search results attached to the class Class (the class selector in question is for the surrounding div):

  var aPicture = $ (".rg_i"); A.picture.click ()   

will select the first image in the results.

No comments:

Post a Comment