[Solved] How to interact my button with my function
[ad_1] For something to happen when the user clicks, you must add an event handler (or callback function) to the element in question. That is done with the .addEventListener() method of the element: // Get a reference to the button let btn = document.getElementById(“b1”); // Add an event handler for the click event btn.addEventListener(“click”, myFunction); … Read more