document.getelementbyid.clicl code example Example: javascript click button by id var button = document.getElementById("button"); button.click();