Answers for "if button clicked javascript"

6

how to detect a button click in javascript

if(document.getElementById('button').clicked == true)
{
   alert("button was clicked");
}
Posted by: Guest on December-10-2019
5

how to check if you click something in javascript

// get the element
const element = document.getElementById('profile_title')

// always checking if the element is clicked, if so, do alert('hello')
element.addEventListener("click", () => {
	alert('hello');
});
Posted by: Guest on September-05-2020
0

javascript clicked anything

window.addEventListener("click", function(event) {
});
Posted by: Guest on September-17-2021
0

calling function on click html

<img src="hospital.png" id="hospitals" onclick="damarkers();">
Posted by: Guest on June-27-2020

Code answers related to "if button clicked javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language