// Create variable for what you are trying to click let button = document.querySelector("#IDofItem"); // Click the button if (button) { button.click(); } else { console.log("Error"); }