Answers for "onclick link run ttwo functions"

4

run a function when a button has the onclick

<script>
function myFunction() {
  alert("ALERT THIS FUNCTION HAS RUNNED");
}
</script>
<button onclick="myFunction">click to run function</button>
Posted by: Guest on September-22-2020
0

button click event call url

<input type="button" value="My Button" 
onclick="location.href = 'https://myurl'" />
Posted by: Guest on June-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language