how to detect click event in javascript code example
Example 1: how to detect a button click in javascript
if(document.getElementById('button').clicked == true)
{
alert("button was clicked");
}
Example 2: how to detect clicks with javascript
element.addEventListener('click', function () {
alert('Clicked!')
});