how to check if you click something in javascript
snippet in javascript

how to check if you click something in javascript

user2823

// 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');
});

how to check if the button is clicked or not in javascript

user5165

if(document.getElementbyId("id do item").clicked == true){
	window.alert("ok")   
}