document.getelementbyid click event code example
Example 1: javascript click button by id
var button = document.getElementById("button");
button.click();
Example 2: javascript click
const element = document.querySelector('element');
element.click();