Answers for "how to check if you click something in javascript"

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

Code answers related to "how to check if you click something in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language