all modals can close using press esc key by human.
I want to do this through javascript code without actual human intervention
I run the following code through the browser console, but it does not work at all
Can anyone solve my problem?
document.dispatchEvent(new KeyboardEvent('keydown', {'key': 'Escape'}));
To test, you can go to the link and test
2
Answers
Perhaps this will work.
This worked for me