Triggering Click Event will Retrun true but will not work

Here is a target for the test:

https://demo.wpjobboard.net/wp-login.php

I need to click on login button using javascript and I use this peice of code:

document.querySelectorAll('[id="wp-submit"]')[0].dispatchEvent(new Event('click'));

I need to use dispatchEvent because the click event here can be replaced with any event.

It will return true but it won’t work. where is the problem?

22 thoughts on “Triggering Click Event will Retrun true but will not work”

Leave a Comment