-
Notifications
You must be signed in to change notification settings - Fork 0
/
51.js
25 lines (22 loc) · 1.05 KB
/
51.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// An event is an important part of JavaScript.A web page respond according to an event occurred. Some events are user generated and some are generated by API’s. An event listener is a procedure in JavaScript that waits for an event to occur. The simple example of an event is a user clicking the mouse or pressing a key on the keyboard.
//Example when I press subscribe,youtube subscribes me to the youtube channel
function hide() {
let para = document.getElementById('para');
let btn = document.getElementById('btn');
console.log(para.style.display);
if (para.style.display != 'none') {
para.style.display = 'none';
}
else {
para.style.display = 'block';
}
}
let para = document.getElementById('para');
para.addEventListener('mouseover', function run(){
alert('Mouse Inside');
console.log('Mouse Inside');
});
para.addEventListener('mouseout', function run(){
alert('Mouse Outside');
console.log('Mouse Outside');
});