1//Use window.onload to to execute JavaScript only after the HTML has loaded
2//Syntax:
3window.onload = function() {
4 //JavaScript goes here
5}
1var element = document.getElementById("#id");
2element.addEventListener('click', function(){
3 console.log("click");
4});