Mirolon
Mirolon

Reputation: 1

JQuery automatic click after 4 sec

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

Upvotes: 0

Views: 18850

Answers (2)

jAndy
jAndy

Reputation: 235962

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');

Upvotes: 4

Mirolon
Mirolon

Reputation: 1

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>

Upvotes: 0

Related Questions