Skip to content

Instantly share code, notes, and snippets.

@wpflames
Created November 30, 2020 09:28
Show Gist options
  • Select an option

  • Save wpflames/48b1aca000de45c835e99ef1a984b97f to your computer and use it in GitHub Desktop.

Select an option

Save wpflames/48b1aca000de45c835e99ef1a984b97f to your computer and use it in GitHub Desktop.
JavaScript addEventListener click
var btn = document.getElementById('button');
btn.addEventListener('click', loadText);
function loadText(){
console.log('button clicked');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment