From Controller to View and Back
by Alex Cowan
HTML
<button id='da-button'>
click me!
</button>
JavaScript
//find the "Go" button in the HTML body
const daButton = document.getElementById('da-button');
//listen for the user clicking on it and if they do, call function 'goClick'
daButton.addEventListener('click', clickCheck);
function clickCheck() {
console.log('click!');
}