1

Here is Google registration page. There is a dropdown list. How to simulate click on it using jQuery? My code doesn't work.

$('#Gender').click()

enter image description here

P.S. I am wiritng userscript for another google website and there are same dropdowns. So I don't want to make a script for autoregistration, don't worry.

Vlad Holubiev
  • 4,876
  • 7
  • 44
  • 59

3 Answers3

0

try $('#Gender').trigger("click");

Ondrej Janacek
  • 12,486
  • 14
  • 59
  • 93
leat
  • 1,418
  • 1
  • 15
  • 21
0

You can do it with HTML + javascript, but it works only on Chrome.

Check this Stack Overflow answer.

Community
  • 1
  • 1
Tomer
  • 3,149
  • 23
  • 26
0

By looking your screenshot it appear that it is not a real dropdown (i.e. select tag) .

I believe your are using kendodropdown or jquery UI combobox or etc .

it change the dropdown to span,textbox combination and also change the id. To fire click event first inspect the element ,then bind it using the actual generated id or you can use class to bind the event .

if this doesn't help you provide html and javascript .

  • You can check the [Google registration page](https://accounts.google.com/SignUp) for the html and javascript – Tomer Dec 07 '13 at 19:36