update
This commit is contained in:
parent
962caebbb7
commit
87bf53d076
1825 changed files with 94929 additions and 0 deletions
13
2-ui/2-events-and-interfaces/4-event-bubbling/both.view/script.js
Executable file
13
2-ui/2-events-and-interfaces/4-event-bubbling/both.view/script.js
Executable file
|
@ -0,0 +1,13 @@
|
|||
|
||||
var elems = document.querySelectorAll('form,div,p');
|
||||
|
||||
for(var i=0; i<elems.length; i++) {
|
||||
elems[i].addEventListener("click", highlightThis, true);
|
||||
elems[i].addEventListener("click", highlightThis, false);
|
||||
}
|
||||
|
||||
function highlightThis() {
|
||||
this.style.backgroundColor = 'yellow';
|
||||
alert(this.tagName);
|
||||
this.style.backgroundColor = '';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue