Simulating Click

The HTMLElement.click() method simulates a mouse click on an element.

Ticking a checkbox programmatically...
RESETRUNFULL
<!DOCTYPE html><html><head></head><body><input type="checkbox"
            onclick="alert('Have I been clicked?')"/>
    <script>
        setTimeout(()=>{
            document.querySelector("input").click();
        },3000);
    </script></body></html>