Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> </head> <body> <button id="buttonId" onclick="alert('Clicked');">Autoclick</button> <script> let event = new Event("click"); buttonId.dispatchEvent(event); </script> </body> </html>