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:

Gladys
24 days ago
Ooh, option A sounds promising. 'Event.clicked'? That must be the answer, right? What could possibly go wrong?
upvoted 0 times
...
Gianna
26 days ago
Option B? Really? 'e.nodeTarget == this'? That doesn't even make sense. C is the clear winner here.
upvoted 0 times
Sharan
9 days ago
I think option A is the correct one.
upvoted 0 times
...
...
Paola
1 months ago
Option D is just completely off the mark. That's not how you detect a button click in this scenario. I'm definitely choosing C.
upvoted 0 times
Ciara
6 days ago
I think option C is the correct replacement for the conditional statement.
upvoted 0 times
...
Bettina
28 days ago
I'm going with option C as well, it seems like the most logical answer.
upvoted 0 times
...
Carline
29 days ago
I think option B might work too, but option C seems more reliable.
upvoted 0 times
...
Mohammad
29 days ago
I agree, option D is not the correct way to detect a button click.
upvoted 0 times
...
Nichelle
1 months ago
I agree, option C is the correct choice here.
upvoted 0 times
...
...
Vincent
1 months ago
I'm going to go with option C as well. It looks like the most straightforward way to check the target element's node name and see if it's a button.
upvoted 0 times
...
Alaine
2 months 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
Kathrine
21 days ago
Yeah, option C seems like the most logical choice. It specifically targets button elements.
upvoted 0 times
...
Major
23 days ago
I agree, option C makes sense. It checks if the target element is a button.
upvoted 0 times
...
...
Reed
2 months ago
I'm not sure, but I think D) button.addEventListener('click') could also work to detect button clicks.
upvoted 0 times
...
Glen
2 months ago
I agree with Winfred. Option C makes sense because it specifically targets buttons.
upvoted 0 times
...
Winfred
2 months 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