Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Javascript Developer I Topic 2 Question 90 Discussion

Actual exam question for Salesforce's Javascript Developer I exam
Question #: 90
Topic #: 2
[All Javascript Developer I Questions]

Given the following code:

document.body.addEventListener(' click ', (event) => {

if (/* CODE REPLACEMENT HERE */) {

console.log('button clicked!');

)

});

Which replacement for the conditional statement on line 02 allows a developer to

correctly determine that a button on page is clicked?

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

Alaine
13 days ago
Hmm, I think option C is the correct answer. The code is checking if the clicked element is a button, which seems like the right way to detect a button click.
upvoted 0 times
...
Reed
15 days ago
I'm not sure, but I think D) button.addEventListener('click') could also work to detect button clicks.
upvoted 0 times
...
Glen
16 days ago
I agree with Winfred. Option C makes sense because it specifically targets buttons.
upvoted 0 times
...
Winfred
17 days ago
I think the correct answer is C) event.target.nodeName == 'BUTTON'. It checks if the target element is a button.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77