0

I'm not an programmer, but I know something. I need very simple script for GreaseMonkey (JQuery). Script which after 4 sec click on link (http://ptzplace.eu/login.php here is it). I need script which click on "Login click" after 4 sec.

BTW. It's simulator and u can put in login and password anything u want for test.

Regards

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
Mirolon
  • 1
  • 1
  • 1
  • 1

2 Answers2

4

setTimeout() && jQuerys .trigger() should do it:

setTimeout(function() {
    $('#login_button_id').trigger('click');
}, 4e3);

Demo: http://jsfiddle.net/WTJgt/9/

update

In reference to your comment, just change the selector. Query by classname:

$('.logIn').trigger('click');
Hello71
  • 766
  • 8
  • 17
jAndy
  • 231,737
  • 57
  • 305
  • 359
0

But what if button doesn't have an id? Look at the source, it's only class. look at source ptzplace.eu ;): <a class="signIn" href="#" onClick="doLogin(); return false;"></a>

Mirolon
  • 1
  • 1
  • 1
  • 1
  • You might want to look at how jQuery selectors work ( http://api.jquery.com/category/selectors/ ) -- you don't need to have an id. – Dan Esparza Jan 27 '11 at 15:50