In vanilla JavaScript, the equivalent of the jQuery click function would be the onclick property. The onclick property in JavaScript is an event property of HTML elements that allows you to specify a function to be called when an element is clicked. When you use onclick property in JavaScript it will overwrite any previous onclick function, you might want to look into addEventListener, it appends a function.
Source code viewer
document.getElementById("element_id").onclick = function() { // Code to be executed when the event is triggered. }; // Fire a synthetic pointer event named click at this element. document.querySelector(".my_class").click();Programming Language: Javascript