how to know which button clicked in javascript

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

Source

Also in JavaScript: