[Solved] use html button to call javascript function [closed]
I don’t fully understand your question, but I’m guessing you want your solve() function to execute when a button is pressed. Here are three options: window.onload = function() { var button = document.getElementById(“button”); // Method 1 button.addEventListener(“click”, function() { alert(“clicked1”); solve(a, b, c); // ^ Insert Params ^ }); // Method 2 button.onclick = function() … Read more