0

There is a button on an website which used to be clickable,however it is currently not, but it's onClick event is still intact. Is it possible to trigger this event? picture for reference

phuzi
  • 12,078
  • 3
  • 26
  • 50
  • This should point you in the right direction: https://stackoverflow.com/questions/2381572/how-can-i-trigger-a-javascript-event-click – Lisa Aug 03 '22 at 08:14
  • Does this answer your question? [How can I trigger a JavaScript event click](https://stackoverflow.com/questions/2381572/how-can-i-trigger-a-javascript-event-click) – Lisa Aug 03 '22 at 08:15

2 Answers2

0

In the console, select the button and use dispatchEvent() like this:

document.querySelector('.property.change').dispatchEvent(new Event('click'))
Brother58697
  • 2,290
  • 2
  • 4
  • 12
0

You can right-click the element, click use in console, and add a .click() after the variable it should have auto-filled.

Right-click menu

Console with .click() call

Julian
  • 105
  • 1
  • 5
  • Thank you for your answer. This seems to be the correct method, as I tested it with the other buttons in the site, but it seems that this specific function must read something from remote server and therefore it has been disabled from there. – Jack Daniels Aug 03 '22 at 10:30