Newbie here! How to simulate keypress(enter) or simulate a click on a button?

18 views
Skip to first unread message

Patrick Famorca

unread,
Aug 26, 2015, 3:31:20 PM8/26/15
to Chromium-extensions
Newbie here! How to simulate keypress(enter) or simulate a click on a button?

PhistucK

unread,
Aug 26, 2015, 3:46:04 PM8/26/15
to Patrick Famorca, Chromium-extensions
If I recall correctly (search the group for past discussions), you cannot simulate Enter. A click can be simulated using the click() ​method on elements.
For example -
document.querySelector(".some-button-element").click();


PhistucK

On Wed, Aug 26, 2015 at 10:31 PM, Patrick Famorca <captc...@gmail.com> wrote:
Newbie here! How to simulate keypress(enter) or simulate a click on a button?

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/2ac3ad7f-ea5d-45a7-b833-8972d8c9bb04%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Muzaffer Tolga Ozses

unread,
Aug 26, 2015, 3:52:11 PM8/26/15
to Patrick Famorca, Chromium-extensions

You can do so by listening to keypress code 13.

On 26/08/2015 10:31 PM, "Patrick Famorca" <captc...@gmail.com> wrote:
Newbie here! How to simulate keypress(enter) or simulate a click on a button?

--

PhistucK

unread,
Aug 26, 2015, 4:07:00 PM8/26/15
to Muzaffer Tolga Ozses, Patrick Famorca, Chromium-extensions
No, this is the way to detect such a key press, not to simulate it.


PhistucK

Reply all
Reply to author
Forward
0 new messages