JavaScript AddEventListener
var element = document.getElementById("#id");
element.addEventListener('click', function(){
console.log("click");
});
Innocent Ibis
var element = document.getElementById("#id");
element.addEventListener('click', function(){
console.log("click");
});
var element=document.getElementById("some_id");
var listener=element.addEventListener('click',function(event){
});
window.addEventListener("scroll", function(){
console.log('scrolling');
});
function first(){
alert( " hi it's Toofi");
}
task3Element.addEventListener('click', first);
// The anwer of Innocent Ibis is wrong!!
// It should not have a # for the ID seens we are using getElementById
var element = document.getElementById("id");
element.addEventListener('click', function(){
console.log("click");
});
var element = document.getElementById("#id");
element.addEventListener('click', function(){
console.log("click");
});