document.querySelector('html').onclick = function() {
alert('Ouch! Stop poking me!');
}
Events are things browser or user do it like click,scroll,press keyboard.
const button =document.querySelector('#submit)
//Click,Scroll,Resizing the browser
button.addEventListener('click', function(){
console.log('New Item added'); //when button with id #submit click it console.log
})
//this is an event detector for a mouseclick with Jquery
$('#id').on('click',function(){
yourFunction(args);
});
addEventListener("code", function() {
// code
});
// An event is triggered when a user clicks on the #button element,
// which then sets the #button element's background-color to blue.
$('#button').on('click', event => {
$(event.currentTarget).css('background-color', 'blue');
});
let array_1 = [1, 2, 3, 4, 5, 6];