Summer Certification Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: force70

Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 6 Topic 1 Discussion

Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 6 Topic 1 Discussion

JavaScript-Developer-I Exam Topic 1 Question 6 Discussion:
Question #: 6
Topic #: 1

Refer to the code below:

< html >

< body >

< div id= " logo " > Hello Logo! < /div >

< button id= " test " > Click me < /button >

< /body >

< script >

function printMessage(event) {

console.log( ' This is a test message ' );

}

let el = document.getElementById( ' test ' );

el.addEventListener( " click " , printMessage, false);

< /script >

< /html >

Which action should be done?


A.

Add event.removeEventListener(); to window.onload event handler


B.

Add event.removeEventListener(); to printMessage function


C.

Add event.stopPropagation(); to printMessage function


D.

Add event.stopPropagation(); to window.onload event handler


Get Premium JavaScript-Developer-I Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.