Skip to content Skip to sidebar Skip to footer

Simulate Click On Spacebar Each 5 Seconds In Jquery

i want to simulate a click on spacebar each 5 minutes, how can i do that , i know that the ascii code for spacebar is 32 In jQuery how i we do that ?

Solution 1:

Here is a plunker that demonstrates sending a keypress to an element every 750ms, but you can configure the time as appropriate

http://plnkr.co/edit/33yTNn1dKFhKMwSls5MU

Solution 2:

You should rather assign an event handler function to the keypress event of the control of your choice and then setup a setInterval that calls the same function.

Post a Comment for "Simulate Click On Spacebar Each 5 Seconds In Jquery"