Question: 8. Consider the following fragments of HTML and JavaScript: HTML: A B D JavaScript Function callback_Func(event) { console.log(event.target.id + ' + event.currentTarget.id) 3 document.getElementById('a').addEventListener(click, callback_Func,

 8. Consider the following fragments of HTML and JavaScript: HTML: A

8. Consider the following fragments of HTML and JavaScript: HTML:

A
B
D

JavaScript Function callback_Func(event) { console.log(event.target.id + "' + event.currentTarget.id) 3 document.getElementById('a').addEventListener("click", callback_Func, false); document.getElementById('b').addEventListener("click", callback_Func, false). document.getElementById('c').addEventListener("click", callback_Func, false) document.getElementById('d').addEventListener("click", callback_Func, false); 1) What would be printed out if the user clicked on the letter 'D' on the webpage above? 2) If we change the JavaScript so that the third argument to each addEventListener() call is true (i.e. register them as capture rather than bubble listeners). what would be printed out if we clicked on the letter 'C

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!