1// Create variable for what you are trying to click
2let button = document.querySelector("#IDofItem");
3
4// Click the button
5
6if (button) {
7 button.click();
8}
9else {
10 console.log("Error");
11}
1document.getElementById('button').onclick = function() {
2 alert("button was clicked");
3};
1<script>
2 $(document).ready(function(){
3 $('#MyButton').click(function(){
4 CapacityChart();
5 });
6 });
7</script>
8
9<input type="button" value="Capacity Chart" id="MyButton" >