How to listen to click event in JavaScript

Last updated Nov 11, 2017
const element = document.querySelector('css-selector');

element.addEventListener('click', event => {
    console.log('Element clicked');
});